summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/Acl/Domain/ObjectIdentityTest.php26
-rw-r--r--Tests/Http/Firewall/SwitchUserListenerTest.php2
2 files changed, 16 insertions, 12 deletions
diff --git a/Tests/Acl/Domain/ObjectIdentityTest.php b/Tests/Acl/Domain/ObjectIdentityTest.php
index 111ae8a..312f433 100644
--- a/Tests/Acl/Domain/ObjectIdentityTest.php
+++ b/Tests/Acl/Domain/ObjectIdentityTest.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Security\Tests\Acl\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\Tests\Acl\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\Tests\Acl\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\Tests\Acl\Domain
diff --git a/Tests/Http/Firewall/SwitchUserListenerTest.php b/Tests/Http/Firewall/SwitchUserListenerTest.php
index 7ba71d4..1852751 100644
--- a/Tests/Http/Firewall/SwitchUserListenerTest.php
+++ b/Tests/Http/Firewall/SwitchUserListenerTest.php
@@ -53,7 +53,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('setResopnse');
+ $this->event->expects($this->never())->method('setResponse');
$this->securityContext->expects($this->never())->method('setToken');
$listener = new SwitchUserListener($this->securityContext, $this->userProvider, $this->userChecker, 'provider123', $this->accessDecisionManager);