X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FUserBundle%2FController%2FManageControllerTest.php;h=4faddfc4da7a6e81616a285e1dc3d882f3c61161;hb=78295b99dd1721c613f1ce52e2debbe6f6db7753;hp=247eb6ba9c20be239a43d380f09d10135afbf614;hpb=152fcccd4489378a8ed9391e3e191df4aeba6435;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php index 247eb6ba..4faddfc4 100644 --- a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php +++ b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php @@ -23,7 +23,7 @@ class ManageControllerTest extends WallabagCoreTestCase // Create a new user in the database $crawler = $client->request('GET', '/users/'); - $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /users/"); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET /users/'); $crawler = $client->click($crawler->selectLink('user.list.create_new_one')->link()); // Fill in the form and submit it @@ -49,7 +49,6 @@ class ManageControllerTest extends WallabagCoreTestCase 'user[username]' => 'test_user', 'user[email]' => 'test@test.io', 'user[enabled]' => true, - 'user[locked]' => false, )); $client->submit($form); @@ -68,4 +67,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]); + } }