diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2019-06-21 12:08:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-21 12:08:59 +0300 |
commit | c1eff72bdf91df623bb377967270befd5c1594f9 (patch) | |
tree | ec79e8297f225212bebbf3ef64b1e2e6106f937f /apps/user_ldap/tests | |
parent | 08734326da2bf8aef1856129ac547e6d4358d805 (diff) | |
parent | 29449f85b688deb1f103f3f67993475a040b4d80 (diff) |
Merge pull request #15964 from nextcloud/enh/noid/user-creation-options
Opt-in for generation userid, requiring email addresses
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r-- | apps/user_ldap/tests/User_LDAPTest.php | 19 |
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() { |