summaryrefslogtreecommitdiffstats
path: root/Guard/Tests/Provider/GuardAuthenticationProviderTest.php
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2016-12-19 16:53:49 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2016-12-19 16:53:49 +0100
commita57c25800dcd39387a9a831ef8f436a6bebb8e72 (patch)
tree536a2ddb082b1cd251fdc04ff8d9e5700593f805 /Guard/Tests/Provider/GuardAuthenticationProviderTest.php
parent05b01b879902a75c64b610a28d1f0dc0bee58c91 (diff)
parent674b38ff1ae98e993fd18e599120ead43705c4bc (diff)
downloadsymfony-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 'Guard/Tests/Provider/GuardAuthenticationProviderTest.php')
-rw-r--r--Guard/Tests/Provider/GuardAuthenticationProviderTest.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/Guard/Tests/Provider/GuardAuthenticationProviderTest.php b/Guard/Tests/Provider/GuardAuthenticationProviderTest.php
index bfcf24b..e7e323a 100644
--- a/Guard/Tests/Provider/GuardAuthenticationProviderTest.php
+++ b/Guard/Tests/Provider/GuardAuthenticationProviderTest.php
@@ -27,9 +27,9 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
$providerKey = 'my_cool_firewall';
- $authenticatorA = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface');
- $authenticatorB = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface');
- $authenticatorC = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface');
+ $authenticatorA = $this->getMockBuilder('Symfony\Component\Security\Guard\GuardAuthenticatorInterface')->getMock();
+ $authenticatorB = $this->getMockBuilder('Symfony\Component\Security\Guard\GuardAuthenticatorInterface')->getMock();
+ $authenticatorC = $this->getMockBuilder('Symfony\Component\Security\Guard\GuardAuthenticatorInterface')->getMock();
$authenticators = array($authenticatorA, $authenticatorB, $authenticatorC);
// called 2 times - for authenticator A and B (stops on B because of match)
@@ -52,7 +52,7 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
$authenticatorC->expects($this->never())
->method('getUser');
- $mockedUser = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
+ $mockedUser = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
$authenticatorB->expects($this->once())
->method('getUser')
->with($enteredCredentials, $this->userProvider)
@@ -63,7 +63,7 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->with($enteredCredentials, $mockedUser)
// authentication works!
->will($this->returnValue(true));
- $authedToken = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ $authedToken = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
$authenticatorB->expects($this->once())
->method('createAuthenticatedToken')
->with($mockedUser, $providerKey)
@@ -89,7 +89,7 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
{
$providerKey = 'my_uncool_firewall';
- $authenticator = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface');
+ $authenticator = $this->getMockBuilder('Symfony\Component\Security\Guard\GuardAuthenticatorInterface')->getMock();
// make sure the authenticator is used
$this->preAuthenticationToken->expects($this->any())
@@ -101,7 +101,7 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
->method('getCredentials')
->will($this->returnValue('non-null-value'));
- $mockedUser = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
+ $mockedUser = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
$authenticator->expects($this->once())
->method('getUser')
->will($this->returnValue($mockedUser));
@@ -124,7 +124,7 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
// create a token and mark it as NOT authenticated anymore
// this mimics what would happen if a user "changed" between request
- $mockedUser = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
+ $mockedUser = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
$token = new PostAuthenticationGuardToken($mockedUser, $providerKey, array('ROLE_USER'));
$token->setAuthenticated(false);
@@ -134,8 +134,8 @@ class GuardAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
- $this->userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
- $this->userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
+ $this->userProvider = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserProviderInterface')->getMock();
+ $this->userChecker = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserCheckerInterface')->getMock();
$this->preAuthenticationToken = $this->getMockBuilder('Symfony\Component\Security\Guard\Token\PreAuthenticationGuardToken')
->disableOriginalConstructor()
->getMock();