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/Helper/RedirectTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/Wallabag/CoreBundle/Helper/RedirectTest.php') diff --git a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php index 0539f20a..f420d06a 100644 --- a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php +++ b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php @@ -89,4 +89,22 @@ class RedirectTest extends \PHPUnit_Framework_TestCase $this->assertEquals($this->routerMock->generate('homepage'), $redirectUrl); } + + public function testUserForRedirectWithIgnoreActionMarkAsRead() + { + $this->token->getUser()->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE); + + $redirectUrl = $this->redirect->to('/unread/list', '', true); + + $this->assertEquals('/unread/list', $redirectUrl); + } + + public function testUserForRedirectNullWithFallbackWithIgnoreActionMarkAsRead() + { + $this->token->getUser()->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE); + + $redirectUrl = $this->redirect->to(null, 'fallback', true); + + $this->assertEquals('fallback', $redirectUrl); + } } -- cgit v1.2.3