diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-10-30 16:09:58 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-10-30 16:10:35 +0300 |
commit | 82bb002eaa07a122144fd471a88b4ee9ea5d2f7f (patch) | |
tree | 7af9ecda34122992035326a16f8a5ad50f005528 | |
parent | 908e6be07effdd3f47b70c8f5b12f1ea88b1d871 (diff) |
adjust tests to 13 codebase
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | apps/user_ldap/tests/User/UserTest.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index 7970c1e80c8..b97931983f7 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -1247,12 +1247,15 @@ class UserTest extends \Test\TestCase { list(, $config, $filesys, $image, $log, $avaMgr, $userMgr, $notiMgr) = $this->getTestInstances(); + $user = new User( + 'user', 'cn=user', $this->access, $config, $filesys, $image, $log, $avaMgr, $userMgr, $notiMgr); + $config->expects($this->once()) ->method('setUserValue'); $oldName = $expectTriggerChange ? 'xxGunslingerxx' : null; - $this->config->expects($this->once()) + $config->expects($this->once()) ->method('getUserValue') - ->with($this->user->getUsername(), 'user_ldap', 'displayName', null) + ->with($user->getUsername(), 'user_ldap', 'displayName', null) ->willReturn($oldName); $ncUserObj = $this->createMock(\OC\User\User::class); @@ -1264,29 +1267,32 @@ class UserTest extends \Test\TestCase { $ncUserObj->expects($this->never()) ->method('triggerChange'); } - $this->userManager->expects($this->once()) + $userMgr->expects($this->once()) ->method('get') ->willReturn($ncUserObj); - $user = new User( - 'user', 'cn=user', $this->access, $config, $filesys, $image, $log, $avaMgr, $userMgr, $notiMgr); - $displayName = $user->composeAndStoreDisplayName($part1, $part2); $this->assertSame($expected, $displayName); } public function testComposeAndStoreDisplayNameNoOverwrite() { + list(, $config, $filesys, $image, $log, $avaMgr, $userMgr, $notiMgr) = + $this->getTestInstances(); + + $user = new User( + 'user', 'cn=user', $this->access, $config, $filesys, $image, $log, $avaMgr, $userMgr, $notiMgr); + $displayName = 'Randall Flagg'; - $this->config->expects($this->never()) + $config->expects($this->never()) ->method('setUserValue'); - $this->config->expects($this->once()) + $config->expects($this->once()) ->method('getUserValue') ->willReturn($displayName); - $this->userManager->expects($this->never()) + $userMgr->expects($this->never()) ->method('get'); // Implicit: no triggerChange can be called - $composedDisplayName = $this->user->composeAndStoreDisplayName($displayName); + $composedDisplayName = $user->composeAndStoreDisplayName($displayName); $this->assertSame($composedDisplayName, $displayName); } |