diff options
Diffstat (limited to 'Core/Tests/Authorization')
4 files changed, 10 insertions, 10 deletions
diff --git a/Core/Tests/Authorization/AuthorizationCheckerTest.php b/Core/Tests/Authorization/AuthorizationCheckerTest.php index aafc12f..eed361c 100644 --- a/Core/Tests/Authorization/AuthorizationCheckerTest.php +++ b/Core/Tests/Authorization/AuthorizationCheckerTest.php @@ -23,8 +23,8 @@ class AuthorizationCheckerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->authenticationManager = $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'); - $this->accessDecisionManager = $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface'); + $this->authenticationManager = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface')->getMock(); + $this->accessDecisionManager = $this->getMockBuilder('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface')->getMock(); $this->tokenStorage = new TokenStorage(); $this->authorizationChecker = new AuthorizationChecker( @@ -36,10 +36,10 @@ class AuthorizationCheckerTest extends \PHPUnit_Framework_TestCase public function testVoteAuthenticatesTokenIfNecessary() { - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); $this->tokenStorage->setToken($token); - $newToken = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + $newToken = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); $this->authenticationManager ->expects($this->once()) @@ -78,7 +78,7 @@ class AuthorizationCheckerTest extends \PHPUnit_Framework_TestCase */ public function testIsGranted($decide) { - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); $token ->expects($this->once()) ->method('isAuthenticated') diff --git a/Core/Tests/Authorization/Voter/AuthenticatedVoterTest.php b/Core/Tests/Authorization/Voter/AuthenticatedVoterTest.php index 60e2a19..d685f0f 100644 --- a/Core/Tests/Authorization/Voter/AuthenticatedVoterTest.php +++ b/Core/Tests/Authorization/Voter/AuthenticatedVoterTest.php @@ -62,11 +62,11 @@ class AuthenticatedVoterTest extends \PHPUnit_Framework_TestCase protected function getToken($authenticated) { if ('fully' === $authenticated) { - return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + return $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); } elseif ('remembered' === $authenticated) { - return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken', array('setPersistent'), array(), '', false); + return $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\RememberMeToken')->setMethods(array('setPersistent'))->disableOriginalConstructor()->getMock(); } else { - return $this->getMock('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken', null, array('', '')); + return $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken')->setConstructorArgs(array('', ''))->getMock(); } } } diff --git a/Core/Tests/Authorization/Voter/RoleVoterTest.php b/Core/Tests/Authorization/Voter/RoleVoterTest.php index 45535ca..5918fd8 100644 --- a/Core/Tests/Authorization/Voter/RoleVoterTest.php +++ b/Core/Tests/Authorization/Voter/RoleVoterTest.php @@ -50,7 +50,7 @@ class RoleVoterTest extends \PHPUnit_Framework_TestCase foreach ($roles as $i => $role) { $roles[$i] = new Role($role); } - $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); $token->expects($this->once()) ->method('getRoles') ->will($this->returnValue($roles)); diff --git a/Core/Tests/Authorization/Voter/VoterTest.php b/Core/Tests/Authorization/Voter/VoterTest.php index 4bac44d..cbd2755 100644 --- a/Core/Tests/Authorization/Voter/VoterTest.php +++ b/Core/Tests/Authorization/Voter/VoterTest.php @@ -21,7 +21,7 @@ class VoterTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); + $this->token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock(); } public function getTests() |