]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/UserBundle/Controller/ManageControllerTest.php
Disabled delete button for the logged user
[github/wallabag/wallabag.git] / tests / Wallabag / UserBundle / Controller / ManageControllerTest.php
index 247eb6ba9c20be239a43d380f09d10135afbf614..19b824b87bc0eddf7794833609b3b582c96d7b43 100644 (file)
@@ -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]);
+    }
 }