diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-30 12:50:02 +0200 |
---|---|---|
committer | Côme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com> | 2022-04-01 12:18:03 +0000 |
commit | d7a291039dd5d58a020ef69c83f00dc15473d962 (patch) | |
tree | fe12ce900752eb6ee6f02ff359f2cd0798fca7a4 /apps/user_ldap/tests | |
parent | 91d6e88c2fb3f59163979f1e00a35364ec24cb1e (diff) | |
download | nextcloud-server-d7a291039dd5d58a020ef69c83f00dc15473d962.tar.gz nextcloud-server-d7a291039dd5d58a020ef69c83f00dc15473d962.zip |
Fix user_ldap unit tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r-- | apps/user_ldap/tests/GroupLDAPPluginTest.php | 16 | ||||
-rw-r--r-- | apps/user_ldap/tests/Group_LDAPTest.php | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php index b55f57990a0..660608d6b1f 100644 --- a/apps/user_ldap/tests/GroupLDAPPluginTest.php +++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php @@ -84,7 +84,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager->createGroup('group'); } - + public function testCreateGroupNotRegistered() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements createGroup in this LDAP Backend.'); @@ -108,13 +108,13 @@ class GroupLDAPPluginTest extends \Test\TestCase { ->method('deleteGroup') ->with( $this->equalTo('group') - ); + )->willReturn(true); $pluginManager->register($plugin); - $pluginManager->deleteGroup('group'); + $this->assertTrue($pluginManager->deleteGroup('group')); } - + public function testDeleteGroupNotRegistered() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements deleteGroup in this LDAP Backend.'); @@ -145,7 +145,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager->addToGroup('uid', 'gid'); } - + public function testAddToGroupNotRegistered() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements addToGroup in this LDAP Backend.'); @@ -176,7 +176,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager->removeFromGroup('uid', 'gid'); } - + public function testRemoveFromGroupNotRegistered() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements removeFromGroup in this LDAP Backend.'); @@ -207,7 +207,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager->countUsersInGroup('gid', 'search'); } - + public function testCountUsersInGroupNotRegistered() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements countUsersInGroup in this LDAP Backend.'); @@ -237,7 +237,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager->getGroupDetails('gid'); } - + public function testgetGroupDetailsNotRegistered() { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements getGroupDetails in this LDAP Backend.'); diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index f8327c0776c..6204c22cb9e 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -1092,7 +1092,7 @@ class Group_LDAPTest extends TestCase { $pluginManager->expects($this->once()) ->method('deleteGroup') ->with('gid') - ->willReturn('result'); + ->willReturn(true); $mapper = $this->getMockBuilder(GroupMapping::class) ->setMethods(['unmap']) @@ -1108,7 +1108,7 @@ class Group_LDAPTest extends TestCase { $ldap = new GroupLDAP($access, $pluginManager); - $this->assertEquals($ldap->deleteGroup('gid'), 'result'); + $this->assertTrue($ldap->deleteGroup('gid')); } |