summaryrefslogtreecommitdiffstats
path: root/Core/Tests/User
diff options
context:
space:
mode:
Diffstat (limited to 'Core/Tests/User')
-rw-r--r--Core/Tests/User/ChainUserProviderTest.php4
-rw-r--r--Core/Tests/User/LdapUserProviderTest.php38
-rw-r--r--Core/Tests/User/UserCheckerTest.php16
3 files changed, 29 insertions, 29 deletions
diff --git a/Core/Tests/User/ChainUserProviderTest.php b/Core/Tests/User/ChainUserProviderTest.php
index ab01f47..dae58ae 100644
--- a/Core/Tests/User/ChainUserProviderTest.php
+++ b/Core/Tests/User/ChainUserProviderTest.php
@@ -173,11 +173,11 @@ class ChainUserProviderTest extends \PHPUnit_Framework_TestCase
protected function getAccount()
{
- return $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
}
protected function getProvider()
{
- return $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface');
+ return $this->getMockBuilder('Symfony\Component\Security\Core\User\UserProviderInterface')->getMock();
}
}
diff --git a/Core/Tests/User/LdapUserProviderTest.php b/Core/Tests/User/LdapUserProviderTest.php
index b942e76..a1ef0bb 100644
--- a/Core/Tests/User/LdapUserProviderTest.php
+++ b/Core/Tests/User/LdapUserProviderTest.php
@@ -28,7 +28,7 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testLoadUserByUsernameFailsIfCantConnectToLdap()
{
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$ldap
->expects($this->once())
->method('bind')
@@ -44,8 +44,8 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testLoadUserByUsernameFailsIfNoLdapEntries()
{
- $result = $this->getMock(CollectionInterface::class);
- $query = $this->getMock(QueryInterface::class);
+ $result = $this->getMockBuilder(CollectionInterface::class)->getMock();
+ $query = $this->getMockBuilder(QueryInterface::class)->getMock();
$query
->expects($this->once())
->method('execute')
@@ -56,7 +56,7 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
->method('count')
->will($this->returnValue(0))
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$ldap
->expects($this->once())
->method('escape')
@@ -77,8 +77,8 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testLoadUserByUsernameFailsIfMoreThanOneLdapEntry()
{
- $result = $this->getMock(CollectionInterface::class);
- $query = $this->getMock(QueryInterface::class);
+ $result = $this->getMockBuilder(CollectionInterface::class)->getMock();
+ $query = $this->getMockBuilder(QueryInterface::class)->getMock();
$query
->expects($this->once())
->method('execute')
@@ -89,7 +89,7 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
->method('count')
->will($this->returnValue(2))
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$ldap
->expects($this->once())
->method('escape')
@@ -110,14 +110,14 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testLoadUserByUsernameFailsIfMoreThanOneLdapPasswordsInEntry()
{
- $result = $this->getMock(CollectionInterface::class);
- $query = $this->getMock(QueryInterface::class);
+ $result = $this->getMockBuilder(CollectionInterface::class)->getMock();
+ $query = $this->getMockBuilder(QueryInterface::class)->getMock();
$query
->expects($this->once())
->method('execute')
->will($this->returnValue($result))
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$result
->expects($this->once())
->method('offsetGet')
@@ -156,14 +156,14 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
*/
public function testLoadUserByUsernameFailsIfEntryHasNoPasswordAttribute()
{
- $result = $this->getMock(CollectionInterface::class);
- $query = $this->getMock(QueryInterface::class);
+ $result = $this->getMockBuilder(CollectionInterface::class)->getMock();
+ $query = $this->getMockBuilder(QueryInterface::class)->getMock();
$query
->expects($this->once())
->method('execute')
->will($this->returnValue($result))
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$result
->expects($this->once())
->method('offsetGet')
@@ -198,14 +198,14 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
public function testLoadUserByUsernameIsSuccessfulWithoutPasswordAttribute()
{
- $result = $this->getMock(CollectionInterface::class);
- $query = $this->getMock(QueryInterface::class);
+ $result = $this->getMockBuilder(CollectionInterface::class)->getMock();
+ $query = $this->getMockBuilder(QueryInterface::class)->getMock();
$query
->expects($this->once())
->method('execute')
->will($this->returnValue($result))
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$result
->expects($this->once())
->method('offsetGet')
@@ -240,14 +240,14 @@ class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
public function testLoadUserByUsernameIsSuccessfulWithPasswordAttribute()
{
- $result = $this->getMock(CollectionInterface::class);
- $query = $this->getMock(QueryInterface::class);
+ $result = $this->getMockBuilder(CollectionInterface::class)->getMock();
+ $query = $this->getMockBuilder(QueryInterface::class)->getMock();
$query
->expects($this->once())
->method('execute')
->will($this->returnValue($result))
;
- $ldap = $this->getMock(LdapInterface::class);
+ $ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
$result
->expects($this->once())
->method('offsetGet')
diff --git a/Core/Tests/User/UserCheckerTest.php b/Core/Tests/User/UserCheckerTest.php
index ac21781..4b6e527 100644
--- a/Core/Tests/User/UserCheckerTest.php
+++ b/Core/Tests/User/UserCheckerTest.php
@@ -19,14 +19,14 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new UserChecker();
- $this->assertNull($checker->checkPostAuth($this->getMock('Symfony\Component\Security\Core\User\UserInterface')));
+ $this->assertNull($checker->checkPostAuth($this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock()));
}
public function testCheckPostAuthPass()
{
$checker = new UserChecker();
- $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface');
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
$account->expects($this->once())->method('isCredentialsNonExpired')->will($this->returnValue(true));
$this->assertNull($checker->checkPostAuth($account));
@@ -39,7 +39,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new UserChecker();
- $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface');
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
$account->expects($this->once())->method('isCredentialsNonExpired')->will($this->returnValue(false));
$checker->checkPostAuth($account);
@@ -49,14 +49,14 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new UserChecker();
- $this->assertNull($checker->checkPreAuth($this->getMock('Symfony\Component\Security\Core\User\UserInterface')));
+ $this->assertNull($checker->checkPreAuth($this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock()));
}
public function testCheckPreAuthPass()
{
$checker = new UserChecker();
- $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface');
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true));
$account->expects($this->once())->method('isEnabled')->will($this->returnValue(true));
$account->expects($this->once())->method('isAccountNonExpired')->will($this->returnValue(true));
@@ -71,7 +71,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new UserChecker();
- $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface');
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(false));
$checker->checkPreAuth($account);
@@ -84,7 +84,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new UserChecker();
- $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface');
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true));
$account->expects($this->once())->method('isEnabled')->will($this->returnValue(false));
@@ -98,7 +98,7 @@ class UserCheckerTest extends \PHPUnit_Framework_TestCase
{
$checker = new UserChecker();
- $account = $this->getMock('Symfony\Component\Security\Core\User\AdvancedUserInterface');
+ $account = $this->getMockBuilder('Symfony\Component\Security\Core\User\AdvancedUserInterface')->getMock();
$account->expects($this->once())->method('isAccountNonLocked')->will($this->returnValue(true));
$account->expects($this->once())->method('isEnabled')->will($this->returnValue(true));
$account->expects($this->once())->method('isAccountNonExpired')->will($this->returnValue(false));