From fdc90ceb172bb7b237e34a1a01f53018c09f514b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 24 Jun 2016 11:55:45 +0200 Subject: Change the way to login user in tests Instead of using a HTTP request we just login user like FOSUser does. It allows us to mock service in container for functional tests. Also, fix a bad config name in fos_user for firewall And finally, add functional test to PocketImport --- tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/Wallabag/CoreBundle/Controller/TagControllerTest.php') diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index a019d36c..58450e5f 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php @@ -39,6 +39,12 @@ class TagControllerTest extends WallabagCoreTestCase $client->submit($form, $data); $this->assertEquals(302, $client->getResponse()->getStatusCode()); + // be sure to reload the entry + $entry = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUsernameAndNotArchived('admin'); + $this->assertEquals(1, count($entry->getTags())); # tag already exists and already assigned -- cgit v1.2.3