summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
authorChristian Flothmann <christian.flothmann@sensiolabs.de>2016-11-28 08:59:03 +0100
committerChristian Flothmann <christian.flothmann@sensiolabs.de>2016-12-07 09:55:32 +0100
commita39290c2fc59213b11f62bbce19e366ac69dbf8b (patch)
treeb7621cb909b1756a5df39f05072b18ffebbb8fda /Http
parent63744a5bb1e02c4ce0e017d701882ac1587c79e0 (diff)
downloadsymfony-security-a39290c2fc59213b11f62bbce19e366ac69dbf8b.zip
symfony-security-a39290c2fc59213b11f62bbce19e366ac69dbf8b.tar.gz
symfony-security-a39290c2fc59213b11f62bbce19e366ac69dbf8b.tar.bz2
[Security] deprecate the RoleInterface
Diffstat (limited to 'Http')
-rw-r--r--Http/Tests/Firewall/SwitchUserListenerTest.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/Http/Tests/Firewall/SwitchUserListenerTest.php b/Http/Tests/Firewall/SwitchUserListenerTest.php
index 28d73e0..140a580 100644
--- a/Http/Tests/Firewall/SwitchUserListenerTest.php
+++ b/Http/Tests/Firewall/SwitchUserListenerTest.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Security\Http\Tests\Firewall;
+use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Http\Event\SwitchUserEvent;
use Symfony\Component\Security\Http\Firewall\SwitchUserListener;
use Symfony\Component\Security\Http\SecurityEvents;
@@ -66,7 +67,7 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testExitUserThrowsAuthenticationExceptionIfOriginalTokenCannotBeFound()
{
- $token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
+ $token = $this->getToken(array(new Role('the role')));
$this->tokenStorage->expects($this->any())->method('getToken')->will($this->returnValue($token));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('_exit'));
@@ -216,7 +217,7 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase
*/
public function testSwitchUserIsDisallowed()
{
- $token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
+ $token = $this->getToken(array(new Role('the role')));
$this->tokenStorage->expects($this->any())->method('getToken')->will($this->returnValue($token));
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue('kuba'));
@@ -231,7 +232,7 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase
public function testSwitchUser()
{
- $token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
+ $token = $this->getToken(array(new Role('the role')));
$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$user->expects($this->any())->method('getRoles')->will($this->returnValue(array()));
@@ -261,7 +262,7 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase
public function testSwitchUserKeepsOtherQueryStringParameters()
{
- $token = $this->getToken(array($this->getMock('Symfony\Component\Security\Core\Role\RoleInterface')));
+ $token = $this->getToken(array(new Role('the role')));
$user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
$user->expects($this->any())->method('getRoles')->will($this->returnValue(array()));