]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/UserBundle/Controller/ManageControllerTest.php
Enable PHPStan
[github/wallabag/wallabag.git] / tests / Wallabag / UserBundle / Controller / ManageControllerTest.php
index 44b9a0301c51e11b4ba255c6b0c13a266f6f0af8..f44e6fbf60028b9e7b9ebb5f918abc8810f2a0fb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-namespace Wallabag\UserBundle\Tests\Controller;
+namespace Tests\Wallabag\UserBundle\Controller;
 
 use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
 
@@ -12,7 +12,7 @@ class ManageControllerTest extends WallabagCoreTestCase
 
         $client->request('GET', '/users/list');
 
-        $this->assertEquals(302, $client->getResponse()->getStatusCode());
+        $this->assertSame(302, $client->getResponse()->getStatusCode());
         $this->assertContains('login', $client->getResponse()->headers->get('location'));
     }
 
@@ -23,16 +23,16 @@ class ManageControllerTest extends WallabagCoreTestCase
 
         // Create a new user in the database
         $crawler = $client->request('GET', '/users/list');
-        $this->assertEquals(200, $client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET /users/');
+        $this->assertSame(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
-        $form = $crawler->selectButton('user.form.save')->form(array(
+        $form = $crawler->selectButton('user.form.save')->form([
             'new_user[username]' => 'test_user',
             'new_user[email]' => 'test@test.io',
-            'new_user[plainPassword][first]' => 'test',
-            'new_user[plainPassword][second]' => 'test',
-        ));
+            'new_user[plainPassword][first]' => 'testtest',
+            'new_user[plainPassword][second]' => 'testtest',
+        ]);
 
         $client->submit($form);
         $client->followRedirect();
@@ -44,12 +44,12 @@ class ManageControllerTest extends WallabagCoreTestCase
         // Edit the user
         $crawler = $client->click($crawler->selectLink('user.list.edit_action')->last()->link());
 
-        $form = $crawler->selectButton('user.form.save')->form(array(
+        $form = $crawler->selectButton('user.form.save')->form([
             'user[name]' => 'Foo User',
             'user[username]' => 'test_user',
             'user[email]' => 'test@test.io',
             'user[enabled]' => true,
-        ));
+        ]);
 
         $client->submit($form);
         $crawler = $client->followRedirect();
@@ -73,10 +73,10 @@ class ManageControllerTest extends WallabagCoreTestCase
         $this->logInAs('admin');
         $client = $this->getClient();
 
-        $crawler = $client->request('GET', '/users/'.$this->getLoggedInUserId().'/edit');
+        $crawler = $client->request('GET', '/users/' . $this->getLoggedInUserId() . '/edit');
         $disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
 
-        $this->assertEquals('disabled', $disabled[0]);
+        $this->assertSame('disabled', $disabled[0]);
     }
 
     public function testUserSearch()