diff options
author | Adrien Samson <adrien@kyklydse.com> | 2013-02-07 21:06:50 +0100 |
---|---|---|
committer | Adrien Samson <adrien@kyklydse.com> | 2013-02-07 21:22:30 +0100 |
commit | 49342d68ed1dd7eec52d30cf40280996dca6873d (patch) | |
tree | 6b92e6d7c9f1c6270a5aed7d27a4c5933c341182 /Tests/Http | |
parent | 1c556ad72cfb835726456d1ef63664a105b9ddf2 (diff) | |
download | symfony-security-49342d68ed1dd7eec52d30cf40280996dca6873d.zip symfony-security-49342d68ed1dd7eec52d30cf40280996dca6873d.tar.gz symfony-security-49342d68ed1dd7eec52d30cf40280996dca6873d.tar.bz2 |
[Security] fixed session creation on login (closes #7011)
Diffstat (limited to 'Tests/Http')
-rw-r--r-- | Tests/Http/Firewall/ContextListenerTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/Http/Firewall/ContextListenerTest.php b/Tests/Http/Firewall/ContextListenerTest.php index 2a8a28e..ffe6195 100644 --- a/Tests/Http/Firewall/ContextListenerTest.php +++ b/Tests/Http/Firewall/ContextListenerTest.php @@ -99,6 +99,25 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase $listener = new ContextListener($this->securityContext, array(), 'session'); $listener->onKernelResponse($event); + $this->assertTrue($session->isStarted()); + } + + public function testOnKernelResponseWithoutSessionNorToken() + { + $request = new Request(); + $session = new Session(new MockArraySessionStorage()); + $request->setSession($session); + + $event = new FilterResponseEvent( + $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), + $request, + HttpKernelInterface::MASTER_REQUEST, + new Response() + ); + + $listener = new ContextListener($this->securityContext, array(), 'session'); + $listener->onKernelResponse($event); + $this->assertFalse($session->isStarted()); } |