diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-10-05 17:17:54 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-10-05 17:17:54 +0200 |
commit | 427c50c174f7ae307d61a722da4ab53e87819041 (patch) | |
tree | 6d5a0c89a0065ac6cdeb0f2120cf283b7e45a241 /Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php | |
parent | d666540ae19bf54addb355f7ff325a6016608a33 (diff) | |
parent | 545528ff1e7a50a50b8e91f27bd667d66a140b14 (diff) | |
download | symfony-security-427c50c174f7ae307d61a722da4ab53e87819041.zip symfony-security-427c50c174f7ae307d61a722da4ab53e87819041.tar.gz symfony-security-427c50c174f7ae307d61a722da4ab53e87819041.tar.bz2 |
Merge branch '2.3' into 2.7
* 2.3:
[Security][bugfix] "Remember me" cookie cleared on logout with custom "secure"/"httponly" config options [1]
[ci] Use current PHP_BINARY when running ./phpunit
Fixed typos
[UPGRADE-3.0] fix bullet indentation
[Security] InMemoryUserProvider now concerns whether user's password is changed when refreshing
Diffstat (limited to 'Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php')
-rw-r--r-- | Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php b/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php index 8383cec..28e9604 100644 --- a/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php +++ b/Http/Tests/RememberMe/TokenBasedRememberMeServicesTest.php @@ -153,7 +153,7 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase public function testLogout() { - $service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null)); + $service = $this->getService(null, array('name' => 'foo', 'path' => null, 'domain' => null, 'secure' => true, 'httponly' => false)); $request = new Request(); $response = new Response(); $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); @@ -164,6 +164,8 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase $this->assertTrue($cookie->isCleared()); $this->assertEquals('/', $cookie->getPath()); $this->assertNull($cookie->getDomain()); + $this->assertTrue($cookie->isSecure()); + $this->assertFalse($cookie->isHttpOnly()); } public function testLoginFail() @@ -264,6 +266,13 @@ class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase $userProvider = $this->getProvider(); } + if (!isset($options['secure'])) { + $options['secure'] = false; + } + if (!isset($options['httponly'])) { + $options['httponly'] = true; + } + $service = new TokenBasedRememberMeServices(array($userProvider), 'fookey', 'fookey', $options, $logger); return $service; |