X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FTests%2FController%2FConfigControllerTest.php;h=5ab9c3295576ea556ffbfe00c574d65744a34f60;hb=4ab58dcf6c833170c307de120698740fe0685efb;hp=11c86423da2348fa1f17e201af8d1d3aff32f453;hpb=1a93ee423b072ec3bcb0c437cbf9b488bdea245c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 11c86423..5ab9c329 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php @@ -2,9 +2,9 @@ namespace Wallabag\CoreBundle\Tests\Controller; -use Wallabag\CoreBundle\Tests\WallabagTestCase; +use Wallabag\CoreBundle\Tests\WallabagCoreTestCase; -class ConfigControllerTest extends WallabagTestCase +class ConfigControllerTest extends WallabagCoreTestCase { public function testLogin() { @@ -27,7 +27,7 @@ class ConfigControllerTest extends WallabagTestCase $this->assertCount(1, $crawler->filter('button[id=config_save]')); $this->assertCount(1, $crawler->filter('button[id=change_passwd_save]')); - $this->assertCount(1, $crawler->filter('button[id=user_save]')); + $this->assertCount(1, $crawler->filter('button[id=update_user_save]')); $this->assertCount(1, $crawler->filter('button[id=new_user_save]')); $this->assertCount(1, $crawler->filter('button[id=rss_config_save]')); } @@ -44,7 +44,7 @@ class ConfigControllerTest extends WallabagTestCase $form = $crawler->filter('button[id=config_save]')->form(); $data = array( - 'config[theme]' => 'baggy', + 'config[theme]' => 0, 'config[items_per_page]' => '30', 'config[language]' => 'fr_FR', ); @@ -63,12 +63,12 @@ class ConfigControllerTest extends WallabagTestCase { return array( array(array( - 'config[theme]' => 'baggy', + 'config[theme]' => 0, 'config[items_per_page]' => '', 'config[language]' => 'fr_FR', )), array(array( - 'config[theme]' => 'baggy', + 'config[theme]' => 0, 'config[items_per_page]' => '12', 'config[language]' => '', )), @@ -102,7 +102,7 @@ class ConfigControllerTest extends WallabagTestCase return array( array( array( - 'change_passwd[old_password]' => 'baggy', + 'change_passwd[old_password]' => 'material', 'change_passwd[new_password][first]' => '', 'change_passwd[new_password][second]' => '', ), @@ -189,25 +189,15 @@ class ConfigControllerTest extends WallabagTestCase return array( array( array( - 'user[username]' => '', - 'user[name]' => '', - 'user[email]' => '', + 'update_user[name]' => '', + 'update_user[email]' => '', ), 'This value should not be blank.', ), array( array( - 'user[username]' => 'ad', - 'user[name]' => '', - 'user[email]' => '', - ), - 'This value is too short.', - ), - array( - array( - 'user[username]' => 'admin', - 'user[name]' => '', - 'user[email]' => 'test', + 'update_user[name]' => '', + 'update_user[email]' => 'test', ), 'This value is not a valid email address.', ), @@ -226,7 +216,7 @@ class ConfigControllerTest extends WallabagTestCase $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $form = $crawler->filter('button[id=user_save]')->form(); + $form = $crawler->filter('button[id=update_user_save]')->form(); $crawler = $client->submit($form, $data); @@ -245,12 +235,11 @@ class ConfigControllerTest extends WallabagTestCase $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $form = $crawler->filter('button[id=user_save]')->form(); + $form = $crawler->filter('button[id=update_user_save]')->form(); $data = array( - 'user[username]' => 'admin', - 'user[name]' => 'new name', - 'user[email]' => 'admin@wallabag.io', + 'update_user[name]' => 'new name', + 'update_user[email]' => 'admin@wallabag.io', ); $client->submit($form, $data); @@ -298,6 +287,14 @@ class ConfigControllerTest extends WallabagTestCase ), 'Password should by at least', ), + array( + array( + 'new_user[username]' => 'admin', + 'new_user[password]' => 'wallacewallace', + 'new_user[email]' => 'wallace@wallace.me', + ), + 'This value is already used', + ), ); } @@ -400,7 +397,7 @@ class ConfigControllerTest extends WallabagTestCase ); $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $content = json_decode($client->getResponse()->getContent(), true);; + $content = json_decode($client->getResponse()->getContent(), true); $this->assertArrayHasKey('token', $content); }