]> 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 6aa5964481c0d2b1754407418d32d21ea3945955..f420d06aefd6293b73807d3952208c0b5c0dbc4e 100644 (file)
@@ -16,9 +16,6 @@ class RedirectTest extends \PHPUnit_Framework_TestCase
     /** @var Redirect */
     private $redirect;
 
-    const PASSWORD = 's3Cr3t';
-    const SALT = '^S4lt$';
-
     public function setUp()
     {
         $this->routerMock = $this->getMockBuilder('Symfony\Component\Routing\Router')
@@ -92,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);
+    }
 }