]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Helper/RedirectTest.php
TagController: ignore ActionMarkAsRead when removing tag from entry
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Helper / RedirectTest.php
index 0539f20a90ddcffd5c24d12e1e25dd9df9eb54f6..f420d06aefd6293b73807d3952208c0b5c0dbc4e 100644 (file)
@@ -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);
+    }
 }