summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Acl/Tests/Domain/ObjectIdentityTest.php26
-rw-r--r--Http/Tests/Firewall/SwitchUserListenerTest.php2
2 files changed, 16 insertions, 12 deletions
diff --git a/Acl/Tests/Domain/ObjectIdentityTest.php b/Acl/Tests/Domain/ObjectIdentityTest.php
index 70f89a3..770ada7 100644
--- a/Acl/Tests/Domain/ObjectIdentityTest.php
+++ b/Acl/Tests/Domain/ObjectIdentityTest.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Security\Acl\Tests\Domain
{
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
+ use Symfony\Component\Security\Acl\Model\DomainObjectInterface;
class ObjectIdentityTest extends \PHPUnit_Framework_TestCase
{
@@ -34,17 +35,7 @@ namespace Symfony\Component\Security\Acl\Tests\Domain
public function testFromDomainObjectPrefersInterfaceOverGetId()
{
- $domainObject = $this->getMock('Symfony\Component\Security\Acl\Model\DomainObjectInterface');
- $domainObject
- ->expects($this->once())
- ->method('getObjectIdentifier')
- ->will($this->returnValue('getObjectIdentifier()'))
- ;
- $domainObject
- ->expects($this->never())
- ->method('getId')
- ->will($this->returnValue('getId()'))
- ;
+ $domainObject = new DomainObjectImplementation();
$id = ObjectIdentity::fromDomainObject($domainObject);
$this->assertEquals('getObjectIdentifier()', $id->getIdentifier());
@@ -121,6 +112,19 @@ namespace Symfony\Component\Security\Acl\Tests\Domain
return $this->id;
}
}
+
+ class DomainObjectImplementation implements DomainObjectInterface
+ {
+ public function getObjectIdentifier()
+ {
+ return 'getObjectIdentifier()';
+ }
+
+ public function getId()
+ {
+ return 'getId()';
+ }
+ }
}
namespace Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Acl\Tests\Domain
diff --git a/Http/Tests/Firewall/SwitchUserListenerTest.php b/Http/Tests/Firewall/SwitchUserListenerTest.php
index f43b564..bcba3c2 100644
--- a/Http/Tests/Firewall/SwitchUserListenerTest.php
+++ b/Http/Tests/Firewall/SwitchUserListenerTest.php
@@ -55,7 +55,7 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase
$this->request->expects($this->any())->method('get')->with('_switch_user')->will($this->returnValue(null));
$this->event->expects($this->never())->method('setResponse');
- $this->tokenStorage->expects($this->never())->method('setToken');
+ $this->securityContext->expects($this->never())->method('setToken');
$listener = new SwitchUserListener($this->tokenStorage, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);
$listener->handle($this->event);