From 5dbf3f2326c4054782304b9a41d773a1100acf48 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 21 May 2017 16:35:06 +0200 Subject: TagController: ignore ActionMarkAsRead when removing tag from entry Fixes #2835 Signed-off-by: Kevin Decherf --- tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | 4 ++++ 1 file changed, 4 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 c3b22dcd..e36d3924 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php @@ -126,9 +126,13 @@ class TagControllerTest extends WallabagCoreTestCase ->getRepository('WallabagCoreBundle:Tag') ->findOneByEntryAndTagLabel($entry, $this->tagName); + // We make a first request to set an history and test redirection after tag deletion + $client->request('GET', '/view/'.$entry->getId()); + $entryUri = $client->getRequest()->getUri(); $client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId()); $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertEquals($entryUri, $client->getResponse()->getTargetUrl()); $this->assertNotContains($this->tagName, $entry->getTags()); -- cgit v1.2.3 From 31485bddb98a2a1b434e62e02ffd79614eca9db8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 31 May 2017 11:11:02 +0200 Subject: Ensure retrieved data are fresh --- 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 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()); -- cgit v1.2.3