summaryrefslogtreecommitdiffstats
path: root/Acl
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2016-12-19 10:02:29 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2016-12-19 16:22:46 +0100
commit0582ad240b9aa4b86945b3fdee0f84b20eb0856f (patch)
treee2eff67cc198e382599df30992fc598c433b9b6e /Acl
parente396644d91c69dd7844f83735832e896e6ed4bf3 (diff)
downloadsymfony-security-0582ad240b9aa4b86945b3fdee0f84b20eb0856f.zip
symfony-security-0582ad240b9aa4b86945b3fdee0f84b20eb0856f.tar.gz
symfony-security-0582ad240b9aa4b86945b3fdee0f84b20eb0856f.tar.bz2
fixed obsolete getMock() usage
Diffstat (limited to 'Acl')
-rw-r--r--Acl/Tests/Dbal/MutableAclProviderTest.php2
-rw-r--r--Acl/Tests/Domain/AclTest.php6
-rw-r--r--Acl/Tests/Domain/AuditLoggerTest.php2
-rw-r--r--Acl/Tests/Domain/EntryTest.php4
-rw-r--r--Acl/Tests/Domain/FieldEntryTest.php4
-rw-r--r--Acl/Tests/Domain/PermissionGrantingStrategyTest.php4
-rw-r--r--Acl/Tests/Domain/SecurityIdentityRetrievalStrategyTest.php6
-rw-r--r--Acl/Tests/Domain/UserSecurityIdentityTest.php2
-rw-r--r--Acl/Tests/Voter/AclVoterTest.php20
9 files changed, 25 insertions, 25 deletions
diff --git a/Acl/Tests/Dbal/MutableAclProviderTest.php b/Acl/Tests/Dbal/MutableAclProviderTest.php
index c2169e4..6df2d79 100644
--- a/Acl/Tests/Dbal/MutableAclProviderTest.php
+++ b/Acl/Tests/Dbal/MutableAclProviderTest.php
@@ -255,7 +255,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
public function testUpdateDoesNothingWhenThereAreNoChanges()
{
- $con = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
+ $con = $this->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock();
$con
->expects($this->never())
->method('beginTransaction')
diff --git a/Acl/Tests/Domain/AclTest.php b/Acl/Tests/Domain/AclTest.php
index 84b9ba9..bfe85e2 100644
--- a/Acl/Tests/Domain/AclTest.php
+++ b/Acl/Tests/Domain/AclTest.php
@@ -208,7 +208,7 @@ class AclTest extends \PHPUnit_Framework_TestCase
{
$sids = array(new RoleSecurityIdentity('ROLE_FOO'), new RoleSecurityIdentity('ROLE_IDDQD'));
$masks = array(1, 2, 4);
- $strategy = $this->getMock('Symfony\Component\Security\Acl\Model\PermissionGrantingStrategyInterface');
+ $strategy = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\PermissionGrantingStrategyInterface')->getMock();
$acl = new Acl(1, new ObjectIdentity(1, 'foo'), $strategy, array(), true);
$strategy
@@ -225,7 +225,7 @@ class AclTest extends \PHPUnit_Framework_TestCase
{
$sids = array(new RoleSecurityIdentity('ROLE_FOO'), new RoleSecurityIdentity('ROLE_IDDQD'));
$masks = array(1, 2, 4);
- $strategy = $this->getMock('Symfony\Component\Security\Acl\Model\PermissionGrantingStrategyInterface');
+ $strategy = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\PermissionGrantingStrategyInterface')->getMock();
$acl = new Acl(1, new ObjectIdentity(1, 'foo'), $strategy, array(), true);
$strategy
@@ -488,7 +488,7 @@ class AclTest extends \PHPUnit_Framework_TestCase
{
$aceProperties = array('aceOrder', 'mask', 'strategy', 'auditSuccess', 'auditFailure');
- $listener = $this->getMock('Doctrine\Common\PropertyChangedListener');
+ $listener = $this->getMockBuilder('Doctrine\Common\PropertyChangedListener')->getMock();
foreach ($expectedChanges as $index => $property) {
if (in_array($property, $aceProperties)) {
$class = 'Symfony\Component\Security\Acl\Domain\Entry';
diff --git a/Acl/Tests/Domain/AuditLoggerTest.php b/Acl/Tests/Domain/AuditLoggerTest.php
index 15538d3..ae11474 100644
--- a/Acl/Tests/Domain/AuditLoggerTest.php
+++ b/Acl/Tests/Domain/AuditLoggerTest.php
@@ -73,7 +73,7 @@ class AuditLoggerTest extends \PHPUnit_Framework_TestCase
protected function getEntry()
{
- return $this->getMock('Symfony\Component\Security\Acl\Model\AuditableEntryInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AuditableEntryInterface')->getMock();
}
protected function getLogger()
diff --git a/Acl/Tests/Domain/EntryTest.php b/Acl/Tests/Domain/EntryTest.php
index ab8e481..58f2786 100644
--- a/Acl/Tests/Domain/EntryTest.php
+++ b/Acl/Tests/Domain/EntryTest.php
@@ -109,11 +109,11 @@ class EntryTest extends \PHPUnit_Framework_TestCase
protected function getAcl()
{
- return $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock();
}
protected function getSid()
{
- return $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Acl\Model\SecurityIdentityInterface')->getMock();
}
}
diff --git a/Acl/Tests/Domain/FieldEntryTest.php b/Acl/Tests/Domain/FieldEntryTest.php
index 735e2e8..55b083c 100644
--- a/Acl/Tests/Domain/FieldEntryTest.php
+++ b/Acl/Tests/Domain/FieldEntryTest.php
@@ -64,11 +64,11 @@ class FieldEntryTest extends \PHPUnit_Framework_TestCase
protected function getAcl()
{
- return $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock();
}
protected function getSid()
{
- return $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Acl\Model\SecurityIdentityInterface')->getMock();
}
}
diff --git a/Acl/Tests/Domain/PermissionGrantingStrategyTest.php b/Acl/Tests/Domain/PermissionGrantingStrategyTest.php
index 34ef690..463f2c1 100644
--- a/Acl/Tests/Domain/PermissionGrantingStrategyTest.php
+++ b/Acl/Tests/Domain/PermissionGrantingStrategyTest.php
@@ -107,7 +107,7 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase
$acl = $this->getAcl($strategy);
$sid = new UserSecurityIdentity('johannes', 'Foo');
- $logger = $this->getMock('Symfony\Component\Security\Acl\Model\AuditLoggerInterface');
+ $logger = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AuditLoggerInterface')->getMock();
$logger
->expects($this->once())
->method('logIfNeeded')
@@ -126,7 +126,7 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase
$acl = $this->getAcl($strategy);
$sid = new UserSecurityIdentity('johannes', 'Foo');
- $logger = $this->getMock('Symfony\Component\Security\Acl\Model\AuditLoggerInterface');
+ $logger = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AuditLoggerInterface')->getMock();
$logger
->expects($this->once())
->method('logIfNeeded')
diff --git a/Acl/Tests/Domain/SecurityIdentityRetrievalStrategyTest.php b/Acl/Tests/Domain/SecurityIdentityRetrievalStrategyTest.php
index 160c27c..579a52e 100644
--- a/Acl/Tests/Domain/SecurityIdentityRetrievalStrategyTest.php
+++ b/Acl/Tests/Domain/SecurityIdentityRetrievalStrategyTest.php
@@ -109,7 +109,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
protected function getAccount($username, $class)
{
- $account = $this->getMock('Symfony\Component\Security\Core\User\UserInterface', array(), array(), $class);
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->setMockClassName($class)->getMock();
$account
->expects($this->any())
->method('getUsername')
@@ -121,7 +121,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
protected function getStrategy(array $roles = array(), $authenticationStatus = 'fullFledged')
{
- $roleHierarchy = $this->getMock('Symfony\Component\Security\Core\Role\RoleHierarchyInterface');
+ $roleHierarchy = $this->getMockBuilder('Symfony\Component\Security\Core\Role\RoleHierarchyInterface')->getMock();
$roleHierarchy
->expects($this->once())
->method('getReachableRoles')
@@ -129,7 +129,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($roles))
;
- $trustResolver = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver', array(), array('', ''));
+ $trustResolver = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver')->setConstructorArgs(array('', ''))->getMock();
$trustResolver
->expects($this->at(0))
diff --git a/Acl/Tests/Domain/UserSecurityIdentityTest.php b/Acl/Tests/Domain/UserSecurityIdentityTest.php
index 09d3f0d..1eb5283 100644
--- a/Acl/Tests/Domain/UserSecurityIdentityTest.php
+++ b/Acl/Tests/Domain/UserSecurityIdentityTest.php
@@ -52,7 +52,7 @@ class UserSecurityIdentityTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('foo'))
;
- $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
$token
->expects($this->any())
->method('getUser')
diff --git a/Acl/Tests/Voter/AclVoterTest.php b/Acl/Tests/Voter/AclVoterTest.php
index 2148135..bf8d674 100644
--- a/Acl/Tests/Voter/AclVoterTest.php
+++ b/Acl/Tests/Voter/AclVoterTest.php
@@ -213,7 +213,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
->expects($this->once())
->method('findAcl')
->with($this->equalTo($oid), $this->equalTo($sids))
- ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface')))
+ ->will($this->returnValue($acl = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock()))
;
$acl
@@ -259,7 +259,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
->expects($this->once())
->method('findAcl')
->with($this->equalTo($oid), $this->equalTo($sids))
- ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface')))
+ ->will($this->returnValue($acl = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock()))
;
$acl
@@ -302,7 +302,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
->expects($this->once())
->method('findAcl')
->with($this->equalTo($oid), $this->equalTo($sids))
- ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface')))
+ ->will($this->returnValue($acl = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock()))
;
$acl
@@ -348,7 +348,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
->expects($this->once())
->method('findAcl')
->with($this->equalTo($oid), $this->equalTo($sids))
- ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface')))
+ ->will($this->returnValue($acl = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock()))
;
$acl
@@ -389,7 +389,7 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
->expects($this->once())
->method('findAcl')
->with($this->equalTo($oid), $this->equalTo($sids))
- ->will($this->returnValue($acl = $this->getMock('Symfony\Component\Security\Acl\Model\AclInterface')))
+ ->will($this->returnValue($acl = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclInterface')->getMock()))
;
$acl
@@ -404,15 +404,15 @@ class AclVoterTest extends \PHPUnit_Framework_TestCase
protected function getToken()
{
- return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
}
protected function getVoter($allowIfObjectIdentityUnavailable = true, $alwaysContains = true)
{
- $provider = $this->getMock('Symfony\Component\Security\Acl\Model\AclProviderInterface');
- $permissionMap = $this->getMock('Symfony\Component\Security\Acl\Permission\PermissionMapInterface');
- $oidStrategy = $this->getMock('Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface');
- $sidStrategy = $this->getMock('Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface');
+ $provider = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\AclProviderInterface')->getMock();
+ $permissionMap = $this->getMockBuilder('Symfony\Component\Security\Acl\Permission\PermissionMapInterface')->getMock();
+ $oidStrategy = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface')->getMock();
+ $sidStrategy = $this->getMockBuilder('Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface')->getMock();
if ($alwaysContains) {
$permissionMap