summaryrefslogtreecommitdiffstats
path: root/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2015-10-05 17:17:54 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2015-10-05 17:17:54 +0200
commit427c50c174f7ae307d61a722da4ab53e87819041 (patch)
tree6d5a0c89a0065ac6cdeb0f2120cf283b7e45a241 /Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
parentd666540ae19bf54addb355f7ff325a6016608a33 (diff)
parent545528ff1e7a50a50b8e91f27bd667d66a140b14 (diff)
downloadsymfony-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/PersistentTokenBasedRememberMeServicesTest.php')
-rw-r--r--Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php b/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
index 2fea626..876b10c 100644
--- a/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
+++ b/Http/Tests/RememberMe/PersistentTokenBasedRememberMeServicesTest.php
@@ -180,7 +180,7 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
public function testLogout()
{
- $service = $this->getService(null, array('name' => 'foo', 'path' => '/foo', 'domain' => 'foodomain.foo'));
+ $service = $this->getService(null, array('name' => 'foo', 'path' => '/foo', 'domain' => 'foodomain.foo', 'secure' => true, 'httponly' => false));
$request = new Request();
$request->cookies->set('foo', $this->encodeCookie(array('fooseries', 'foovalue')));
$response = new Response();
@@ -201,6 +201,8 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$this->assertTrue($cookie->isCleared());
$this->assertEquals('/foo', $cookie->getPath());
$this->assertEquals('foodomain.foo', $cookie->getDomain());
+ $this->assertTrue($cookie->isSecure());
+ $this->assertFalse($cookie->isHttpOnly());
}
public function testLogoutSimplyIgnoresNonSetRequestCookie()
@@ -311,6 +313,13 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test
$userProvider = $this->getProvider();
}
+ if (!isset($options['secure'])) {
+ $options['secure'] = false;
+ }
+ if (!isset($options['httponly'])) {
+ $options['httponly'] = true;
+ }
+
return new PersistentTokenBasedRememberMeServices(array($userProvider), 'fookey', 'fookey', $options, $logger, new SecureRandom(sys_get_temp_dir().'/_sf2.seed'));
}