diff --git a/src/Symfony/Component/Security/Acl/Tests/Domain/ObjectIdentityTest.php b/src/Symfony/Component/Security/Acl/Tests/Domain/ObjectIdentityTest.php index 70f89a3254..770ada7a7b 100644 --- a/src/Symfony/Component/Security/Acl/Tests/Domain/ObjectIdentityTest.php +++ b/src/Symfony/Component/Security/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/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php index f43b564322..bcba3c29f7 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php +++ b/src/Symfony/Component/Security/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);