diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2016-12-19 16:53:49 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2016-12-19 16:53:49 +0100 |
commit | a57c25800dcd39387a9a831ef8f436a6bebb8e72 (patch) | |
tree | 536a2ddb082b1cd251fdc04ff8d9e5700593f805 /Core/Tests/Authorization | |
parent | 05b01b879902a75c64b610a28d1f0dc0bee58c91 (diff) | |
parent | 674b38ff1ae98e993fd18e599120ead43705c4bc (diff) | |
download | symfony-security-a57c25800dcd39387a9a831ef8f436a6bebb8e72.zip symfony-security-a57c25800dcd39387a9a831ef8f436a6bebb8e72.tar.gz symfony-security-a57c25800dcd39387a9a831ef8f436a6bebb8e72.tar.bz2 |
Merge branch '2.8' into 3.1
* 2.8:
fixed obsolete getMock() usage
fixed obsolete getMock() usage
[WebProfilerBundle] Display multiple HTTP headers in WDT
do not remove the Twig ExceptionController service
removed obsolete condition
do not try to register incomplete definitions
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() |