From a1691859ca0cb4c1b360c34b05aa74bdba9e582a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 18 Aug 2015 11:08:45 +0200 Subject: implement FosUser --- src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle/Tests/Controller') diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 5ab9c329..e11da935 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php @@ -266,7 +266,7 @@ class ConfigControllerTest extends WallabagCoreTestCase array( array( 'new_user[username]' => 'ad', - 'new_user[password]' => '', + 'new_user[password]' => 'mypassword', 'new_user[email]' => '', ), 'This value is too short.', @@ -274,7 +274,7 @@ class ConfigControllerTest extends WallabagCoreTestCase array( array( 'new_user[username]' => 'wallace', - 'new_user[password]' => '', + 'new_user[password]' => 'mypassword', 'new_user[email]' => 'test', ), 'This value is not a valid email address.', -- cgit v1.2.3 From 3f7a62908cc34b9d575bea5629dc0bb94e521e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 25 Aug 2015 16:29:22 +0200 Subject: fix tests for FosUser --- .../Tests/Controller/ConfigControllerTest.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/Wallabag/CoreBundle/Tests/Controller') diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index e11da935..116eec60 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php @@ -192,14 +192,14 @@ class ConfigControllerTest extends WallabagCoreTestCase 'update_user[name]' => '', 'update_user[email]' => '', ), - 'This value should not be blank.', + 'Please enter an email', ), array( array( 'update_user[name]' => '', 'update_user[email]' => 'test', ), - 'This value is not a valid email address.', + 'The email is not valid', ), ); } @@ -261,15 +261,15 @@ class ConfigControllerTest extends WallabagCoreTestCase 'new_user[password]' => '', 'new_user[email]' => '', ), - 'This value should not be blank.', + 'Please enter a username', ), array( array( - 'new_user[username]' => 'ad', + 'new_user[username]' => 'a', 'new_user[password]' => 'mypassword', 'new_user[email]' => '', ), - 'This value is too short.', + 'The username is too short', ), array( array( @@ -277,15 +277,7 @@ class ConfigControllerTest extends WallabagCoreTestCase 'new_user[password]' => 'mypassword', 'new_user[email]' => 'test', ), - 'This value is not a valid email address.', - ), - array( - array( - 'new_user[username]' => 'wallace', - 'new_user[password]' => 'admin', - 'new_user[email]' => 'wallace@wallace.me', - ), - 'Password should by at least', + 'The email is not valid', ), array( array( @@ -293,7 +285,7 @@ class ConfigControllerTest extends WallabagCoreTestCase 'new_user[password]' => 'wallacewallace', 'new_user[email]' => 'wallace@wallace.me', ), - 'This value is already used', + 'The username is already used', ), ); } -- cgit v1.2.3 From af43bd37675954f937720f7b6fbcf78d85928bc5 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 11 Sep 2015 16:13:59 +0200 Subject: Fix tests Ensure that created use during install command will always be unique. We assume that the install command must be run to initialize a wallabag instance. NEVER to add more user. Also, use a better way to retrieve the real name of the database and not the one defined in parameters.yml (which isn't the same for test envi because the dbname isn't defined in parameters.yml but directly in config_test.yml) --- src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php | 6 +++--- src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Wallabag/CoreBundle/Tests/Controller') diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index a0966285..a92835b3 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php @@ -209,7 +209,7 @@ class EntryControllerTest extends WallabagCoreTestCase $content = $client->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') - ->findOneById(1); + ->findOneByIsStarred(false); $client->request('GET', '/delete/'.$content->getId()); @@ -360,13 +360,13 @@ class EntryControllerTest extends WallabagCoreTestCase $form['entry_filter[isStarred]']->untick(); $crawler = $client->submit($form); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(2, $crawler->filter('div[class=entry]')); $form = $crawler->filter('button[id=submit-filter]')->form(); $form['entry_filter[isArchived]']->untick(); $form['entry_filter[isStarred]']->tick(); $crawler = $client->submit($form); - $this->assertCount(1, $crawler->filter('div[class=entry]')); + $this->assertCount(2, $crawler->filter('div[class=entry]')); } } diff --git a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php index af39d6ce..d25b2db5 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php @@ -24,7 +24,7 @@ class TagControllerTest extends WallabagCoreTestCase $entry = $client->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') - ->findOneByIsArchived(false); + ->findOneBy(array()); $crawler = $client->request('GET', '/view/'.$entry->getId()); -- cgit v1.2.3