From 31485bddb98a2a1b434e62e02ffd79614eca9db8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 31 May 2017 11:11:02 +0200 Subject: [PATCH] Ensure retrieved data are fresh --- tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | 6 ++++++ 1 file changed, 6 insertions(+) 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()); -- 2.41.0