X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FHelper%2FRedirectTest.php;h=f420d06aefd6293b73807d3952208c0b5c0dbc4e;hb=873f6b8e03079d11fab541aa5b0bc6f8fe2d645e;hp=6aa5964481c0d2b1754407418d32d21ea3945955;hpb=00bf45b6f291b6d1ce5f6a106e8e15bb1cce411b;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php index 6aa59644..f420d06a 100644 --- a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php +++ b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php @@ -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); + } }