From ccc7faec094387681a59faa5ca79a86e33f06972 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Oct 2016 13:21:45 +0200 Subject: Disabled delete button for the logged user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid some bad things to happen… --- tests/Wallabag/UserBundle/Controller/ManageControllerTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/Wallabag/UserBundle/Controller') diff --git a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php index 247eb6ba..19b824b8 100644 --- a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php +++ b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php @@ -68,4 +68,15 @@ class ManageControllerTest extends WallabagCoreTestCase // Check the user has been delete on the list $this->assertNotRegExp('/Foo User/', $client->getResponse()->getContent()); } + + public function testDeleteDisabledForLoggedUser() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/users/'.$this->getLoggedInUserId().'/edit'); + $disabled = $crawler->selectButton('user.form.delete')->extract('disabled'); + + $this->assertEquals('disabled', $disabled[0]); + } } -- cgit v1.2.3