summaryrefslogtreecommitdiffstats
path: root/Tests/Http/Firewall
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-02-11 12:26:43 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2013-02-11 12:26:43 +0100
commit6efa9a2145a067d4034e24f86a0e0e37611472d3 (patch)
tree923b0095782ea8674d758720d95b5ab8fadded6c /Tests/Http/Firewall
parent2790e9e0bdd27ca40c3a6a4a773ca14685ce4d82 (diff)
parent49342d68ed1dd7eec52d30cf40280996dca6873d (diff)
downloadsymfony-security-6efa9a2145a067d4034e24f86a0e0e37611472d3.zip
symfony-security-6efa9a2145a067d4034e24f86a0e0e37611472d3.tar.gz
symfony-security-6efa9a2145a067d4034e24f86a0e0e37611472d3.tar.bz2
Merge branch '2.1' into 2.2
* 2.1: added support for the X-Forwarded-For header (closes #6982, closes #7000) fixed the IP address in HttpCache when calling the backend [EventDispatcher] Added assertion. [EventDispathcer] Fix removeListener [DependencyInjection] Add clone for resources which were introduced in 2.1 [DependencyInjection] Allow frozen containers to be dumped to graphviz Fix 'undefined index' error, when entering scope recursively [Security] fixed session creation on login (closes #7011) Add dot character `.` to legal mime subtype regular expression [HttpFoundation] fixed the creation of sub-requests under some circumstancies (closes #6923, closes #6936)
Diffstat (limited to 'Tests/Http/Firewall')
-rw-r--r--Tests/Http/Firewall/ContextListenerTest.php19
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());
}