summaryrefslogtreecommitdiffstats
path: root/Http/Tests/Firewall
diff options
context:
space:
mode:
authorWouterJ <waldio.webdesign@gmail.com>2016-03-17 09:57:53 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2016-03-23 10:01:34 -0700
commit41b7118c83c443bcea329782c4222ff1a9f510a2 (patch)
tree25e2a4610a09a367b9b541ca6519d01a426fd22e /Http/Tests/Firewall
parent28a00b768e63d8c9f9f143cc387508f033b1939a (diff)
downloadsymfony-security-41b7118c83c443bcea329782c4222ff1a9f510a2.zip
symfony-security-41b7118c83c443bcea329782c4222ff1a9f510a2.tar.gz
symfony-security-41b7118c83c443bcea329782c4222ff1a9f510a2.tar.bz2
[Security] Use auth trust resolver to determine anonymous in ContextListener
Diffstat (limited to 'Http/Tests/Firewall')
-rw-r--r--Http/Tests/Firewall/ContextListenerTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/Http/Tests/Firewall/ContextListenerTest.php b/Http/Tests/Firewall/ContextListenerTest.php
index ae1199a..0213330 100644
--- a/Http/Tests/Firewall/ContextListenerTest.php
+++ b/Http/Tests/Firewall/ContextListenerTest.php
@@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Http\Firewall\ContextListener;
@@ -85,6 +86,13 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($session->has('_security_session'));
}
+ public function testOnKernelResponseWillRemoveSessionOnAnonymousToken()
+ {
+ $session = $this->runSessionOnKernelResponse(new AnonymousToken('secret', 'anon.'), 'C:10:"serialized"');
+
+ $this->assertFalse($session->has('_security_session'));
+ }
+
public function testOnKernelResponseWithoutSession()
{
$tokenStorage = new TokenStorage();