diff options
Diffstat (limited to 'apps/user_ldap/tests/Group_LDAPTest.php')
-rw-r--r-- | apps/user_ldap/tests/Group_LDAPTest.php | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index 06d64b99a4f..58006627410 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -51,7 +51,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend = new GroupLDAP($this->access, $this->pluginManager, $this->config, $this->ncUserManager); } - public function testCountEmptySearchString() { + public function testCountEmptySearchString(): void { $groupDN = 'cn=group,dc=foo,dc=bar'; $this->enableGroups(); @@ -130,7 +130,7 @@ class Group_LDAPTest extends TestCase { }); } - public function testCountWithSearchString() { + public function testCountWithSearchString(): void { $this->enableGroups(); $this->access->expects($this->any()) @@ -174,7 +174,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(2, $users); } - public function testCountUsersWithPlugin() { + public function testCountUsersWithPlugin(): void { /** @var GroupPluginManager|MockObject $pluginManager */ $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) ->setMethods(['implementsActions', 'countUsersInGroup']) @@ -194,7 +194,7 @@ class Group_LDAPTest extends TestCase { $this->assertEquals($this->groupBackend->countUsersInGroup('gid', 'search'), 42); } - public function testGidNumber2NameSuccess() { + public function testGidNumber2NameSuccess(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -214,7 +214,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame('MyGroup', $group); } - public function testGidNumberID2NameNoGroup() { + public function testGidNumberID2NameNoGroup(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -232,7 +232,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(false, $group); } - public function testGidNumberID2NameNoName() { + public function testGidNumberID2NameNoName(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -251,7 +251,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(false, $group); } - public function testGetEntryGidNumberValue() { + public function testGetEntryGidNumberValue(): void { $this->enableGroups(); $dn = 'cn=foobar,cn=foo,dc=barfoo,dc=bar'; @@ -268,7 +268,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame('3117', $gid); } - public function testGetEntryGidNumberNoValue() { + public function testGetEntryGidNumberNoValue(): void { $this->enableGroups(); $dn = 'cn=foobar,cn=foo,dc=barfoo,dc=bar'; @@ -285,7 +285,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(false, $gid); } - public function testPrimaryGroupID2NameSuccessCache() { + public function testPrimaryGroupID2NameSuccessCache(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -313,7 +313,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame('MyGroup', $group); } - public function testPrimaryGroupID2NameSuccess() { + public function testPrimaryGroupID2NameSuccess(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -338,7 +338,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame('MyGroup', $group); } - public function testPrimaryGroupID2NameNoSID() { + public function testPrimaryGroupID2NameNoSID(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -360,7 +360,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(false, $group); } - public function testPrimaryGroupID2NameNoGroup() { + public function testPrimaryGroupID2NameNoGroup(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -383,7 +383,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(false, $group); } - public function testPrimaryGroupID2NameNoName() { + public function testPrimaryGroupID2NameNoName(): void { $this->enableGroups(); $userDN = 'cn=alice,cn=foo,dc=barfoo,dc=bar'; @@ -407,7 +407,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(false, $group); } - public function testGetEntryGroupIDValue() { + public function testGetEntryGroupIDValue(): void { //tests getEntryGroupID via getGroupPrimaryGroupID //which is basically identical to getUserPrimaryGroupIDs $this->enableGroups(); @@ -426,7 +426,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame('3117', $gid); } - public function testGetEntryGroupIDNoValue() { + public function testGetEntryGroupIDNoValue(): void { //tests getEntryGroupID via getGroupPrimaryGroupID //which is basically identical to getUserPrimaryGroupIDs $this->enableGroups(); @@ -449,7 +449,7 @@ class Group_LDAPTest extends TestCase { * tests whether Group Backend behaves correctly when cache with uid and gid * is hit */ - public function testInGroupHitsUidGidCache() { + public function testInGroupHitsUidGidCache(): void { $this->enableGroups(); $uid = 'someUser'; @@ -486,7 +486,7 @@ class Group_LDAPTest extends TestCase { /** * @dataProvider groupWithMembersProvider */ - public function testInGroupMember(string $gid, string $groupDn, array $memberDNs) { + public function testInGroupMember(string $gid, string $groupDn, array $memberDNs): void { $uid = 'someUser'; $userDn = $memberDNs[0]; @@ -527,7 +527,7 @@ class Group_LDAPTest extends TestCase { /** * @dataProvider groupWithMembersProvider */ - public function testInGroupMemberNot(string $gid, string $groupDn, array $memberDNs) { + public function testInGroupMemberNot(string $gid, string $groupDn, array $memberDNs): void { $uid = 'unelatedUser'; $userDn = 'uid=unrelatedUser,ou=unrelatedTeam,ou=unrelatedDepartment,dc=someDomain,dc=someTld'; @@ -568,7 +568,7 @@ class Group_LDAPTest extends TestCase { /** * @dataProvider groupWithMembersProvider */ - public function testInGroupMemberUid(string $gid, string $groupDn, array $memberDNs) { + public function testInGroupMemberUid(string $gid, string $groupDn, array $memberDNs): void { $memberUids = []; $userRecords = []; foreach ($memberDNs as $dn) { @@ -625,7 +625,7 @@ class Group_LDAPTest extends TestCase { $this->assertTrue($this->groupBackend->inGroup($uid, $gid)); } - public function testGetGroupsWithOffset() { + public function testGetGroupsWithOffset(): void { $this->enableGroups(); $this->access->expects($this->once()) @@ -642,7 +642,7 @@ class Group_LDAPTest extends TestCase { * tests that a user listing is complete, if all its members have the group * as their primary. */ - public function testUsersInGroupPrimaryMembersOnly() { + public function testUsersInGroupPrimaryMembersOnly(): void { $this->enableGroups(); $this->access->connection->expects($this->any()) @@ -685,7 +685,7 @@ class Group_LDAPTest extends TestCase { * tests that a user listing is complete, if all its members have the group * as their primary. */ - public function testUsersInGroupPrimaryAndUnixMembers() { + public function testUsersInGroupPrimaryAndUnixMembers(): void { $this->enableGroups(); $this->access->connection->expects($this->any()) @@ -726,7 +726,7 @@ class Group_LDAPTest extends TestCase { * tests that a user counting is complete, if all its members have the group * as their primary. */ - public function testCountUsersInGroupPrimaryMembersOnly() { + public function testCountUsersInGroupPrimaryMembersOnly(): void { $this->enableGroups(); $this->access->connection->expects($this->any()) @@ -761,7 +761,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(4, $users); } - public function testGetUserGroupsMemberOf() { + public function testGetUserGroupsMemberOf(): void { $this->enableGroups(); $dn = 'cn=userX,dc=foobar'; @@ -797,7 +797,7 @@ class Group_LDAPTest extends TestCase { $this->assertSame(2, count($groups)); } - public function testGetUserGroupsMemberOfDisabled() { + public function testGetUserGroupsMemberOfDisabled(): void { $this->access->connection->expects($this->any()) ->method('__get') ->willReturnCallback(function ($name) { @@ -856,7 +856,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->getUserGroups('userX'); } - public function testGetUserGroupsOfflineUser() { + public function testGetUserGroupsOfflineUser(): void { $this->enableGroups(); $offlineUser = $this->createMock(OfflineUser::class); @@ -882,7 +882,7 @@ class Group_LDAPTest extends TestCase { * regression tests against a case where a json object was stored instead of expected list * @see https://github.com/nextcloud/server/issues/42374 */ - public function testGetUserGroupsOfflineUserUnexpectedJson() { + public function testGetUserGroupsOfflineUserUnexpectedJson(): void { $this->enableGroups(); $offlineUser = $this->createMock(OfflineUser::class); @@ -905,7 +905,7 @@ class Group_LDAPTest extends TestCase { $this->assertTrue(in_array('groupF', $returnedGroups)); } - public function testGetUserGroupsUnrecognizedOfflineUser() { + public function testGetUserGroupsUnrecognizedOfflineUser(): void { $this->enableGroups(); $dn = 'cn=userX,dc=foobar'; @@ -958,7 +958,7 @@ class Group_LDAPTest extends TestCase { /** * @dataProvider nestedGroupsProvider */ - public function testGetGroupsByMember(bool $nestedGroups) { + public function testGetGroupsByMember(bool $nestedGroups): void { $groupFilter = '(&(objectclass=nextcloudGroup)(nextcloudEnabled=TRUE))'; $this->access->connection->expects($this->any()) ->method('__get') @@ -1072,7 +1072,7 @@ class Group_LDAPTest extends TestCase { $this->assertEquals($expectedGroupsNames, $groupsAgain); } - public function testCreateGroupWithPlugin() { + public function testCreateGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) ->setMethods(['implementsActions', 'createGroup']) ->getMock(); @@ -1092,7 +1092,7 @@ class Group_LDAPTest extends TestCase { } - public function testCreateGroupFailing() { + public function testCreateGroupFailing(): void { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) @@ -1108,7 +1108,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->createGroup('gid'); } - public function testDeleteGroupWithPlugin() { + public function testDeleteGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) ->setMethods(['implementsActions', 'deleteGroup']) ->getMock(); @@ -1137,7 +1137,7 @@ class Group_LDAPTest extends TestCase { } - public function testDeleteGroupFailing() { + public function testDeleteGroupFailing(): void { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) @@ -1153,7 +1153,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->deleteGroup('gid'); } - public function testAddToGroupWithPlugin() { + public function testAddToGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) ->setMethods(['implementsActions', 'addToGroup']) ->getMock(); @@ -1173,7 +1173,7 @@ class Group_LDAPTest extends TestCase { } - public function testAddToGroupFailing() { + public function testAddToGroupFailing(): void { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) @@ -1189,7 +1189,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->addToGroup('uid', 'gid'); } - public function testRemoveFromGroupWithPlugin() { + public function testRemoveFromGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) ->setMethods(['implementsActions', 'removeFromGroup']) ->getMock(); @@ -1209,7 +1209,7 @@ class Group_LDAPTest extends TestCase { } - public function testRemoveFromGroupFailing() { + public function testRemoveFromGroupFailing(): void { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) @@ -1225,7 +1225,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->removeFromGroup('uid', 'gid'); } - public function testGetGroupDetailsWithPlugin() { + public function testGetGroupDetailsWithPlugin(): void { /** @var GroupPluginManager|MockObject $pluginManager */ $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) ->setMethods(['implementsActions', 'getGroupDetails']) @@ -1245,7 +1245,7 @@ class Group_LDAPTest extends TestCase { $this->assertEquals($this->groupBackend->getGroupDetails('gid'), 'result'); } - public function testGetGroupDetailsFailing() { + public function testGetGroupDetailsFailing(): void { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) @@ -1333,7 +1333,7 @@ class Group_LDAPTest extends TestCase { * @param string[] $expectedMembers * @dataProvider groupMemberProvider */ - public function testGroupMembers(array $expectedResult, ?array $groupsInfo = null) { + public function testGroupMembers(array $expectedResult, ?array $groupsInfo = null): void { $this->access->expects($this->any()) ->method('readAttribute') ->willReturnCallback(function ($group) use ($groupsInfo) { @@ -1372,7 +1372,7 @@ class Group_LDAPTest extends TestCase { /** * @dataProvider displayNameProvider */ - public function testGetDisplayName(string $expected, $ldapResult) { + public function testGetDisplayName(string $expected, $ldapResult): void { $gid = 'graphic_novelists'; $this->access->expects($this->atLeastOnce()) |