diff options
Diffstat (limited to 'apps/user_ldap/tests/User_LDAPTest.php')
-rw-r--r-- | apps/user_ldap/tests/User_LDAPTest.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 0f48d5b3547..5b53cc3da2c 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -210,9 +210,11 @@ class User_LDAPTest extends TestCase { $access = $this->getAccessMock(); $this->prepareAccessForCheckPassword($access); + $access->userManager->expects($this->any()) + ->method('get') + ->willReturn($user); $backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock()); - ->willReturn($user); \OC_User::useBackend($backend); @@ -266,10 +268,11 @@ class User_LDAPTest extends TestCase { $access = $this->getAccessMock(); $this->prepareAccessForCheckPassword($access); - $backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock()); + $access->userManager->expects($this->any()) ->method('get') ->willReturn($user); + $backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock()); \OC_User::useBackend($backend); $result = \OCP\User::checkPassword('roland', 'dt19'); @@ -1196,6 +1199,7 @@ class User_LDAPTest extends TestCase { ->with($this->equalTo('loginName2UserName-'.$loginName), $this->equalTo($username)); $backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock()); + $user = $this->createMock(User::class); $user->expects($this->any()) ->method('getUsername') ->willReturn('alice'); @@ -1363,6 +1367,11 @@ class User_LDAPTest extends TestCase { $access = $this->getAccessMock(); $this->prepareAccessForSetPassword($access); + + $access->userManager->expects($this->any()) + ->method('get') + ->willReturn($this->createMock(User::class)); + $backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock()); $access->userManager->expects($this->any()) ->method('get') |