summaryrefslogtreecommitdiffstats
path: root/Acl
diff options
context:
space:
mode:
authorNicolas Grekas <nicolas.grekas@gmail.com>2016-03-25 16:39:22 +0100
committerNicolas Grekas <nicolas.grekas@gmail.com>2016-03-25 16:39:22 +0100
commit535f34efbde200c28f1f10ba531e24bb95cf55d5 (patch)
treea781ff44b64bff0e07eb06e9bb9515459348615d /Acl
parent1a56ae95e84784bcd003c697a8173921412beee7 (diff)
parentf9e167fde187546f3eb91f62d8de5ba36483a70a (diff)
downloadsymfony-security-535f34efbde200c28f1f10ba531e24bb95cf55d5.zip
symfony-security-535f34efbde200c28f1f10ba531e24bb95cf55d5.tar.gz
symfony-security-535f34efbde200c28f1f10ba531e24bb95cf55d5.tar.bz2
Merge branch '2.3' into 2.7
* 2.3: fix mocks Conflicts: src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
Diffstat (limited to 'Acl')
-rw-r--r--Acl/Tests/Domain/ObjectIdentityTest.php26
1 files changed, 15 insertions, 11 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