summaryrefslogtreecommitdiffstats
path: root/Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php')
-rw-r--r--Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php b/Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php
index da3068f..9359f86 100644
--- a/Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php
+++ b/Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php
@@ -30,9 +30,9 @@ class LdapBindAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testEmptyPasswordShouldThrowAnException()
{
- $userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
- $ldap = $this->getMock('Symfony\Component\Ldap\LdapClientInterface');
- $userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
+ $userProvider = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserProviderInterface')->getMock();
+ $ldap = $this->getMockBuilder('Symfony\Component\Ldap\LdapClientInterface')->getMock();
+ $userChecker = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserCheckerInterface')->getMock();
$provider = new LdapBindAuthenticationProvider($userProvider, $userChecker, 'key', $ldap);
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
@@ -47,14 +47,14 @@ class LdapBindAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testBindFailureShouldThrowAnException()
{
- $userProvider = $this->getMock(UserProviderInterface::class);
- $ldap = $this->getMock(LdapInterface::class);
+ $userProvider = $this->getMockBuilder(UserProviderInterface::class)->getMock();
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$ldap
->expects($this->once())
->method('bind')
->will($this->throwException(new ConnectionException()))
;
- $userChecker = $this->getMock(UserCheckerInterface::class);
+ $userChecker = $this->getMockBuilder(UserCheckerInterface::class)->getMock();
$provider = new LdapBindAuthenticationProvider($userProvider, $userChecker, 'key', $ldap);
$reflection = new \ReflectionMethod($provider, 'checkAuthentication');
@@ -65,15 +65,15 @@ class LdapBindAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
public function testRetrieveUser()
{
- $userProvider = $this->getMock(UserProviderInterface::class);
+ $userProvider = $this->getMockBuilder(UserProviderInterface::class)->getMock();
$userProvider
->expects($this->once())
->method('loadUserByUsername')
->with('foo')
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
- $userChecker = $this->getMock(UserCheckerInterface::class);
+ $userChecker = $this->getMockBuilder(UserCheckerInterface::class)->getMock();
$provider = new LdapBindAuthenticationProvider($userProvider, $userChecker, 'key', $ldap);
$reflection = new \ReflectionMethod($provider, 'retrieveUser');