Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-06-14 18:20:42 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-06-19 18:02:28 +0300
commit660fbd64e34fccb26f1a38d1b67da5618e624875 (patch)
treec7e83a93c4a8565913097204b17461dde2e5c025 /apps/user_ldap/tests
parent5b754a6353d31f0548860f1b17b7c9db0f2ee791 (diff)
ensures mapping of chosen userid
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index e4f7bb8b6d2..9b8bda2b808 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -35,6 +35,7 @@ use OC\User\Backend;
use OC\User\Session;
use OCA\User_LDAP\Access;
use OCA\User_LDAP\Connection;
+use OCA\User_LDAP\Mapping\AbstractMapping;
use OCA\User_LDAP\Mapping\UserMapping;
use OCA\User_LDAP\User\Manager;
use OCA\User_LDAP\User\OfflineUser;
@@ -1437,16 +1438,30 @@ class User_LDAPTest extends TestCase {
}
public function testCreateUserWithPlugin() {
+ $uid = 'alien6372';
+ $uuid = '123-2345-36756-123-2345234-4431';
+ $pwd = 'passwørd';
+
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::CREATE_USER)
->willReturn(true);
$this->pluginManager->expects($this->once())
->method('createUser')
- ->with('uid','password')
+ ->with($uid, $pwd)
->willReturn('result');
- $this->assertEquals($this->backend->createUser('uid', 'password'),true);
+ $this->access->expects($this->atLeastOnce())
+ ->method('getUUID')
+ ->willReturn($uuid);
+ $this->access->expects($this->once())
+ ->method('mapAndAnnounceIfApplicable')
+ ->with($this->isInstanceOf(AbstractMapping::class), $this->anything(), $uid, $uuid, true);
+ $this->access->expects($this->any())
+ ->method('getUserMapper')
+ ->willReturn($this->createMock(AbstractMapping::class));
+
+ $this->assertEquals($this->backend->createUser($uid, $pwd),true);
}
public function testCreateUserFailing() {