From: Jeremy Benoist Date: Wed, 31 May 2017 09:11:02 +0000 (+0200) Subject: Ensure retrieved data are fresh X-Git-Tag: 2.3.0~31^2~81^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=31485bddb98a2a1b434e62e02ffd79614eca9db8;p=github%2Fwallabag%2Fwallabag.git Ensure retrieved data are fresh --- diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index e36d3924..80611a87 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php @@ -134,6 +134,12 @@ class TagControllerTest extends WallabagCoreTestCase $this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals($entryUri, $client->getResponse()->getTargetUrl()); + // re-retrieve the entry to be sure to get fresh data from database (mostly for tags) + $entry = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId()); + $this->assertNotContains($this->tagName, $entry->getTags()); $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());