aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorAnna <anna@nextcloud.com>2024-09-16 00:11:41 +0200
committerGitHub <noreply@github.com>2024-09-16 00:11:41 +0200
commitd46f271b1f3971120386591a3489f74b55f7a7ba (patch)
treeb85cded12ba149b5f594ab4d87c14a189065239a /apps/user_ldap
parentbdb2fdbe90285fa45c5763367e9ecd3ad3cb41a4 (diff)
parente4cf430233b971351e6c736813e2fb40382b828d (diff)
downloadnextcloud-server-d46f271b1f3971120386591a3489f74b55f7a7ba.tar.gz
nextcloud-server-d46f271b1f3971120386591a3489f74b55f7a7ba.zip
Merge pull request #48049 from nextcloud/refactor/void-tests
refactor: Add void return type to PHPUnit test methods
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/tests/AccessTest.php48
-rw-r--r--apps/user_ldap/tests/ConfigurationTest.php6
-rw-r--r--apps/user_ldap/tests/ConnectionTest.php10
-rw-r--r--apps/user_ldap/tests/GroupLDAPPluginTest.php26
-rw-r--r--apps/user_ldap/tests/Group_LDAPTest.php82
-rw-r--r--apps/user_ldap/tests/HelperTest.php6
-rw-r--r--apps/user_ldap/tests/Jobs/CleanUpTest.php12
-rw-r--r--apps/user_ldap/tests/Jobs/SyncTest.php6
-rw-r--r--apps/user_ldap/tests/LDAPProviderTest.php68
-rw-r--r--apps/user_ldap/tests/LDAPTest.php4
-rw-r--r--apps/user_ldap/tests/Mapping/AbstractMappingTest.php22
-rw-r--r--apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php8
-rw-r--r--apps/user_ldap/tests/Migration/UUIDFixInsertTest.php8
-rw-r--r--apps/user_ldap/tests/Settings/AdminTest.php6
-rw-r--r--apps/user_ldap/tests/Settings/SectionTest.php8
-rw-r--r--apps/user_ldap/tests/User/DeletedUsersIndexTest.php4
-rw-r--r--apps/user_ldap/tests/User/ManagerTest.php10
-rw-r--r--apps/user_ldap/tests/User/OfflineUserTest.php2
-rw-r--r--apps/user_ldap/tests/User/UserTest.php62
-rw-r--r--apps/user_ldap/tests/UserLDAPPluginTest.php34
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php106
-rw-r--r--apps/user_ldap/tests/User_ProxyTest.php6
-rw-r--r--apps/user_ldap/tests/WizardTest.php14
23 files changed, 279 insertions, 279 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index b04a9f69e0b..79c0f3216a2 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -122,18 +122,18 @@ class AccessTest extends TestCase {
return [$lw, $connector, $um, $helper];
}
- public function testEscapeFilterPartValidChars() {
+ public function testEscapeFilterPartValidChars(): void {
$input = 'okay';
$this->assertTrue($input === $this->access->escapeFilterPart($input));
}
- public function testEscapeFilterPartEscapeWildcard() {
+ public function testEscapeFilterPartEscapeWildcard(): void {
$input = '*';
$expected = '\\2a';
$this->assertTrue($expected === $this->access->escapeFilterPart($input));
}
- public function testEscapeFilterPartEscapeWildcard2() {
+ public function testEscapeFilterPartEscapeWildcard2(): void {
$input = 'foo*bar';
$expected = 'foo\\2abar';
$this->assertTrue($expected === $this->access->escapeFilterPart($input));
@@ -144,7 +144,7 @@ class AccessTest extends TestCase {
* @param array $sidArray
* @param $sidExpected
*/
- public function testConvertSID2StrSuccess(array $sidArray, $sidExpected) {
+ public function testConvertSID2StrSuccess(array $sidArray, $sidExpected): void {
$sidBinary = implode('', $sidArray);
$this->assertSame($sidExpected, $this->access->convertSID2Str($sidBinary));
}
@@ -176,14 +176,14 @@ class AccessTest extends TestCase {
];
}
- public function testConvertSID2StrInputError() {
+ public function testConvertSID2StrInputError(): void {
$sidIllegal = 'foobar';
$sidExpected = '';
$this->assertSame($sidExpected, $this->access->convertSID2Str($sidIllegal));
}
- public function testGetDomainDNFromDNSuccess() {
+ public function testGetDomainDNFromDNSuccess(): void {
$inputDN = 'uid=zaphod,cn=foobar,dc=my,dc=server,dc=com';
$domainDN = 'dc=my,dc=server,dc=com';
@@ -195,7 +195,7 @@ class AccessTest extends TestCase {
$this->assertSame($domainDN, $this->access->getDomainDNFromDN($inputDN));
}
- public function testGetDomainDNFromDNError() {
+ public function testGetDomainDNFromDNError(): void {
$inputDN = 'foobar';
$expected = '';
@@ -231,7 +231,7 @@ class AccessTest extends TestCase {
* @dataProvider dnInputDataProvider
* @param array $case
*/
- public function testStringResemblesDN($case) {
+ public function testStringResemblesDN($case): void {
[$lw, $con, $um, $helper] = $this->getConnectorAndLdapMock();
/** @var IConfig|MockObject $config */
$config = $this->createMock(IConfig::class);
@@ -253,7 +253,7 @@ class AccessTest extends TestCase {
* @dataProvider dnInputDataProvider
* @param $case
*/
- public function testStringResemblesDNLDAPmod($case) {
+ public function testStringResemblesDNLDAPmod($case): void {
[, $con, $um, $helper] = $this->getConnectorAndLdapMock();
/** @var IConfig|MockObject $config */
$config = $this->createMock(IConfig::class);
@@ -267,14 +267,14 @@ class AccessTest extends TestCase {
$this->assertSame($case['expectedResult'], $access->stringResemblesDN($case['input']));
}
- public function testCacheUserHome() {
+ public function testCacheUserHome(): void {
$this->connection->expects($this->once())
->method('writeToCache');
$this->access->cacheUserHome('foobar', '/foobars/path');
}
- public function testBatchApplyUserAttributes() {
+ public function testBatchApplyUserAttributes(): void {
$this->ldap->expects($this->any())
->method('isResource')
->willReturn(true);
@@ -332,7 +332,7 @@ class AccessTest extends TestCase {
$this->access->batchApplyUserAttributes($data);
}
- public function testBatchApplyUserAttributesSkipped() {
+ public function testBatchApplyUserAttributesSkipped(): void {
/** @var UserMapping|MockObject $mapperMock */
$mapperMock = $this->createMock(UserMapping::class);
$mapperMock->expects($this->any())
@@ -373,7 +373,7 @@ class AccessTest extends TestCase {
$this->access->batchApplyUserAttributes($data);
}
- public function testBatchApplyUserAttributesDontSkip() {
+ public function testBatchApplyUserAttributesDontSkip(): void {
/** @var UserMapping|MockObject $mapperMock */
$mapperMock = $this->createMock(UserMapping::class);
$mapperMock->expects($this->any())
@@ -428,7 +428,7 @@ class AccessTest extends TestCase {
* @dataProvider dNAttributeProvider
* @param $attribute
*/
- public function testSanitizeDN($attribute) {
+ public function testSanitizeDN($attribute): void {
[$lw, $con, $um, $helper] = $this->getConnectorAndLdapMock();
/** @var IConfig|MockObject $config */
$config = $this->createMock(IConfig::class);
@@ -450,7 +450,7 @@ class AccessTest extends TestCase {
}
- public function testSetPasswordWithDisabledChanges() {
+ public function testSetPasswordWithDisabledChanges(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('LDAP password changes are disabled');
@@ -462,7 +462,7 @@ class AccessTest extends TestCase {
$this->access->setPassword('CN=foo', 'MyPassword');
}
- public function testSetPasswordWithLdapNotAvailable() {
+ public function testSetPasswordWithLdapNotAvailable(): void {
$this->connection
->method('__get')
->willReturn(true);
@@ -481,7 +481,7 @@ class AccessTest extends TestCase {
}
- public function testSetPasswordWithRejectedChange() {
+ public function testSetPasswordWithRejectedChange(): void {
$this->expectException(\OCP\HintException::class);
$this->expectExceptionMessage('Password change rejected.');
@@ -503,7 +503,7 @@ class AccessTest extends TestCase {
$this->access->setPassword('CN=foo', 'MyPassword');
}
- public function testSetPassword() {
+ public function testSetPassword(): void {
$this->connection
->method('__get')
->willReturn(true);
@@ -565,7 +565,7 @@ class AccessTest extends TestCase {
->willReturnArgument(0);
}
- public function testSearchNoPagedSearch() {
+ public function testSearchNoPagedSearch(): void {
// scenario: no pages search, 1 search base
$filter = 'objectClass=nextcloudUser';
$base = 'ou=zombies,dc=foobar,dc=nextcloud,dc=com';
@@ -592,7 +592,7 @@ class AccessTest extends TestCase {
$this->assertSame($expected, $result);
}
- public function testFetchListOfUsers() {
+ public function testFetchListOfUsers(): void {
$filter = 'objectClass=nextcloudUser';
$base = 'ou=zombies,dc=foobar,dc=nextcloud,dc=com';
$attrs = ['dn', 'uid'];
@@ -635,7 +635,7 @@ class AccessTest extends TestCase {
$this->assertSame($expected, $list);
}
- public function testFetchListOfGroupsKnown() {
+ public function testFetchListOfGroupsKnown(): void {
$filter = 'objectClass=nextcloudGroup';
$attributes = ['cn', 'gidNumber', 'dn'];
$base = 'ou=SomeGroups,dc=my,dc=directory';
@@ -715,7 +715,7 @@ class AccessTest extends TestCase {
* @param $name
* @param $expected
*/
- public function testSanitizeUsername($name, $expected) {
+ public function testSanitizeUsername($name, $expected): void {
if ($expected === null) {
$this->expectException(\InvalidArgumentException::class);
}
@@ -726,12 +726,12 @@ class AccessTest extends TestCase {
/**
* @dataProvider groupIDCandidateProvider
*/
- public function testSanitizeGroupIDCandidate(string $name, string $expected) {
+ public function testSanitizeGroupIDCandidate(string $name, string $expected): void {
$sanitizedName = $this->access->sanitizeGroupIDCandidate($name);
$this->assertSame($expected, $sanitizedName);
}
- public function testUserStateUpdate() {
+ public function testUserStateUpdate(): void {
$this->connection->expects($this->any())
->method('__get')
->willReturnMap([
diff --git a/apps/user_ldap/tests/ConfigurationTest.php b/apps/user_ldap/tests/ConfigurationTest.php
index 96b08c4cf8a..cced8334bf5 100644
--- a/apps/user_ldap/tests/ConfigurationTest.php
+++ b/apps/user_ldap/tests/ConfigurationTest.php
@@ -89,7 +89,7 @@ class ConfigurationTest extends \Test\TestCase {
/**
* @dataProvider configurationDataProvider
*/
- public function testSetValue($key, $input, $expected) {
+ public function testSetValue($key, $input, $expected): void {
$this->configuration->setConfiguration([$key => $input]);
$this->assertSame($this->configuration->$key, $expected);
}
@@ -108,7 +108,7 @@ class ConfigurationTest extends \Test\TestCase {
/**
* @dataProvider avatarRuleValueProvider
*/
- public function testGetAvatarAttributes($setting, $expected) {
+ public function testGetAvatarAttributes($setting, $expected): void {
$this->configuration->setConfiguration(['ldapUserAvatarRule' => $setting]);
$this->assertSame($expected, $this->configuration->getAvatarAttributes());
}
@@ -116,7 +116,7 @@ class ConfigurationTest extends \Test\TestCase {
/**
* @dataProvider avatarRuleValueProvider
*/
- public function testResolveRule($setting, $expected) {
+ public function testResolveRule($setting, $expected): void {
$this->configuration->setConfiguration(['ldapUserAvatarRule' => $setting]);
// so far the only thing that can get resolved :)
$this->assertSame($expected, $this->configuration->resolveRule('avatar'));
diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php
index dfa3cf6beda..bc65de39f94 100644
--- a/apps/user_ldap/tests/ConnectionTest.php
+++ b/apps/user_ldap/tests/ConnectionTest.php
@@ -39,7 +39,7 @@ class ConnectionTest extends \Test\TestCase {
->willReturn(true);
}
- public function testOriginalAgentUnchangedOnClone() {
+ public function testOriginalAgentUnchangedOnClone(): void {
//background: upon login a bind is done with the user credentials
//which is valid for the whole LDAP resource. It needs to be reset
//to the agent's credentials
@@ -66,7 +66,7 @@ class ConnectionTest extends \Test\TestCase {
$this->assertSame($agentPawd, $agent['ldapAgentPassword']);
}
- public function testUseBackupServer() {
+ public function testUseBackupServer(): void {
$mainHost = 'ldap://nixda.ldap';
$backupHost = 'ldap://fallback.ldap';
$config = [
@@ -125,7 +125,7 @@ class ConnectionTest extends \Test\TestCase {
$this->connection->init();
}
- public function testDontUseBackupServerOnFailedAuth() {
+ public function testDontUseBackupServerOnFailedAuth(): void {
$mainHost = 'ldap://nixda.ldap';
$backupHost = 'ldap://fallback.ldap';
$config = [
@@ -172,7 +172,7 @@ class ConnectionTest extends \Test\TestCase {
$this->connection->init();
}
- public function testBindWithInvalidCredentials() {
+ public function testBindWithInvalidCredentials(): void {
// background: Bind with invalid credentials should return false
// and not throw a ServerNotAvailableException.
@@ -217,7 +217,7 @@ class ConnectionTest extends \Test\TestCase {
}
}
- public function testStartTlsNegotiationFailure() {
+ public function testStartTlsNegotiationFailure(): void {
// background: If Start TLS negotiation fails,
// a ServerNotAvailableException should be thrown.
diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php
index 24cfb5d51e9..f67de32c2e9 100644
--- a/apps/user_ldap/tests/GroupLDAPPluginTest.php
+++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php
@@ -17,7 +17,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
return new GroupPluginManager();
}
- public function testImplementsActions() {
+ public function testImplementsActions(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -44,7 +44,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
$this->assertTrue($pluginManager->implementsActions(GroupInterface::ADD_TO_GROUP));
}
- public function testCreateGroup() {
+ public function testCreateGroup(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -66,7 +66,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
}
- public function testCreateGroupNotRegistered() {
+ public function testCreateGroupNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements createGroup in this LDAP Backend.');
@@ -74,7 +74,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
$pluginManager->createGroup('foo');
}
- public function testDeleteGroup() {
+ public function testDeleteGroup(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -96,7 +96,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
}
- public function testDeleteGroupNotRegistered() {
+ public function testDeleteGroupNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements deleteGroup in this LDAP Backend.');
@@ -104,7 +104,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
$pluginManager->deleteGroup('foo');
}
- public function testAddToGroup() {
+ public function testAddToGroup(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -127,7 +127,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
}
- public function testAddToGroupNotRegistered() {
+ public function testAddToGroupNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements addToGroup in this LDAP Backend.');
@@ -135,7 +135,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
$pluginManager->addToGroup('foo', 'bar');
}
- public function testRemoveFromGroup() {
+ public function testRemoveFromGroup(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -158,7 +158,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
}
- public function testRemoveFromGroupNotRegistered() {
+ public function testRemoveFromGroupNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements removeFromGroup in this LDAP Backend.');
@@ -166,7 +166,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
$pluginManager->removeFromGroup('foo', 'bar');
}
- public function testCountUsersInGroup() {
+ public function testCountUsersInGroup(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -189,7 +189,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
}
- public function testCountUsersInGroupNotRegistered() {
+ public function testCountUsersInGroupNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements countUsersInGroup in this LDAP Backend.');
@@ -197,7 +197,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
$pluginManager->countUsersInGroup('foo', 'bar');
}
- public function testgetGroupDetails() {
+ public function testgetGroupDetails(): void {
$pluginManager = $this->getGroupPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy')
@@ -219,7 +219,7 @@ class GroupLDAPPluginTest extends \Test\TestCase {
}
- public function testgetGroupDetailsNotRegistered() {
+ public function testgetGroupDetailsNotRegistered(): void {
$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 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())
diff --git a/apps/user_ldap/tests/HelperTest.php b/apps/user_ldap/tests/HelperTest.php
index bbb3956f918..38c6a639340 100644
--- a/apps/user_ldap/tests/HelperTest.php
+++ b/apps/user_ldap/tests/HelperTest.php
@@ -26,7 +26,7 @@ class HelperTest extends \Test\TestCase {
$this->helper = new Helper($this->config, \OC::$server->getDatabaseConnection());
}
- public function testGetServerConfigurationPrefixes() {
+ public function testGetServerConfigurationPrefixes(): void {
$this->config->method('getAppKeys')
->with($this->equalTo('user_ldap'))
->willReturn([
@@ -40,7 +40,7 @@ class HelperTest extends \Test\TestCase {
$this->assertEquals(['', 's1'], $result);
}
- public function testGetServerConfigurationPrefixesActive() {
+ public function testGetServerConfigurationPrefixesActive(): void {
$this->config->method('getAppKeys')
->with($this->equalTo('user_ldap'))
->willReturn([
@@ -65,7 +65,7 @@ class HelperTest extends \Test\TestCase {
$this->assertEquals(['s1'], $result);
}
- public function testGetServerConfigurationHost() {
+ public function testGetServerConfigurationHost(): void {
$this->config->method('getAppKeys')
->with($this->equalTo('user_ldap'))
->willReturn([
diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php
index 05d202f82df..582b6fba5d7 100644
--- a/apps/user_ldap/tests/Jobs/CleanUpTest.php
+++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php
@@ -43,7 +43,7 @@ class CleanUpTest extends TestCase {
/**
* clean up job must not run when there are disabled configurations
*/
- public function test_runNotAllowedByDisabledConfigurations() {
+ public function test_runNotAllowedByDisabledConfigurations(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->willReturn(true);
@@ -59,7 +59,7 @@ class CleanUpTest extends TestCase {
* clean up job must not run when LDAP Helper is broken i.e.
* returning unexpected results
*/
- public function test_runNotAllowedByBrokenHelper() {
+ public function test_runNotAllowedByBrokenHelper(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->will($this->throwException(new Exception()));
@@ -74,7 +74,7 @@ class CleanUpTest extends TestCase {
/**
* clean up job must not run when it is not enabled
*/
- public function test_runNotAllowedBySysConfig() {
+ public function test_runNotAllowedBySysConfig(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->willReturn(false);
@@ -90,7 +90,7 @@ class CleanUpTest extends TestCase {
/**
* clean up job is allowed to run
*/
- public function test_runIsAllowed() {
+ public function test_runIsAllowed(): void {
$this->mocks['helper']->expects($this->once())
->method('haveDisabledConfigurations')
->willReturn(false);
@@ -106,7 +106,7 @@ class CleanUpTest extends TestCase {
/**
* check whether offset will be reset when it needs to
*/
- public function test_OffsetResetIsNecessary() {
+ public function test_OffsetResetIsNecessary(): void {
$result = $this->bgJob->isOffsetResetNecessary($this->bgJob->getChunkSize() - 1);
$this->assertSame(true, $result);
}
@@ -114,7 +114,7 @@ class CleanUpTest extends TestCase {
/**
* make sure offset is not reset when it is not due
*/
- public function test_OffsetResetIsNotNecessary() {
+ public function test_OffsetResetIsNotNecessary(): void {
$result = $this->bgJob->isOffsetResetNecessary($this->bgJob->getChunkSize());
$this->assertSame(false, $result);
}
diff --git a/apps/user_ldap/tests/Jobs/SyncTest.php b/apps/user_ldap/tests/Jobs/SyncTest.php
index 379402166e3..8277e7d48a9 100644
--- a/apps/user_ldap/tests/Jobs/SyncTest.php
+++ b/apps/user_ldap/tests/Jobs/SyncTest.php
@@ -152,7 +152,7 @@ class SyncTest extends TestCase {
/**
* @dataProvider moreResultsProvider
*/
- public function testMoreResults($pagingSize, $results, $expected) {
+ public function testMoreResults($pagingSize, $results, $expected): void {
$connection = $this->createMock(Connection::class);
$this->connectionFactory->expects($this->any())
->method('get')
@@ -207,7 +207,7 @@ class SyncTest extends TestCase {
/**
* @dataProvider cycleDataProvider
*/
- public function testDetermineNextCycle($cycleData, $prefixes, $expectedCycle) {
+ public function testDetermineNextCycle($cycleData, $prefixes, $expectedCycle): void {
$this->helper->expects($this->any())
->method('getServerConfigurationPrefixes')
->with(true)
@@ -283,7 +283,7 @@ class SyncTest extends TestCase {
/**
* @dataProvider runDataProvider
*/
- public function testRun($runData) {
+ public function testRun($runData): void {
$this->config->expects($this->any())
->method('getAppValue')
->willReturnCallback(function ($app, $key, $default) use ($runData) {
diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php
index d240b6d65c5..514cc137954 100644
--- a/apps/user_ldap/tests/LDAPProviderTest.php
+++ b/apps/user_ldap/tests/LDAPProviderTest.php
@@ -87,7 +87,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetUserDNUserIDNotFound() {
+ public function testGetUserDNUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -103,7 +103,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getUserDN('nonexisting_user');
}
- public function testGetUserDN() {
+ public function testGetUserDN(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['userExists', 'getLDAPAccess', 'username2dn'])
->disableOriginalConstructor()
@@ -126,7 +126,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetGroupDNGroupIDNotFound() {
+ public function testGetGroupDNGroupIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Group id not found in LDAP');
@@ -147,7 +147,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getGroupDN('nonexisting_group');
}
- public function testGetGroupDN() {
+ public function testGetGroupDN(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['userExists', 'getLDAPAccess', 'username2dn'])
->disableOriginalConstructor()
@@ -175,7 +175,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getGroupDN('existing_group'));
}
- public function testGetUserName() {
+ public function testGetUserName(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['dn2UserName'])
->disableOriginalConstructor()
@@ -191,7 +191,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getUserName('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
}
- public function testDNasBaseParameter() {
+ public function testDNasBaseParameter(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods([])
->disableOriginalConstructor()
@@ -207,7 +207,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->DNasBaseParameter('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
}
- public function testSanitizeDN() {
+ public function testSanitizeDN(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods([])
->disableOriginalConstructor()
@@ -224,7 +224,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetLDAPConnectionUserIDNotFound() {
+ public function testGetLDAPConnectionUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -240,7 +240,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getLDAPConnection('nonexisting_user');
}
- public function testGetLDAPConnection() {
+ public function testGetLDAPConnection(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['userExists', 'getNewLDAPConnection'])
->disableOriginalConstructor()
@@ -260,7 +260,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetGroupLDAPConnectionGroupIDNotFound() {
+ public function testGetGroupLDAPConnectionGroupIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Group id not found in LDAP');
@@ -281,7 +281,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getGroupLDAPConnection('nonexisting_group');
}
- public function testGetGroupLDAPConnection() {
+ public function testGetGroupLDAPConnection(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->disableOriginalConstructor()
->getMock();
@@ -307,7 +307,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetLDAPBaseUsersUserIDNotFound() {
+ public function testGetLDAPBaseUsersUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -323,7 +323,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getLDAPBaseUsers('nonexisting_user');
}
- public function testGetLDAPBaseUsers() {
+ public function testGetLDAPBaseUsers(): void {
$bases = [
'ou=users,ou=foobar,dc=example,dc=org',
'ou=users,ou=barfoo,dc=example,dc=org',
@@ -370,7 +370,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetLDAPBaseGroupsUserIDNotFound() {
+ public function testGetLDAPBaseGroupsUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -386,7 +386,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getLDAPBaseGroups('nonexisting_user');
}
- public function testGetLDAPBaseGroups() {
+ public function testGetLDAPBaseGroups(): void {
$bases = [
'ou=groupd,ou=foobar,dc=example,dc=org',
'ou=groups,ou=barfoo,dc=example,dc=org',
@@ -426,7 +426,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testClearCacheUserIDNotFound() {
+ public function testClearCacheUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -442,7 +442,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->clearCache('nonexisting_user');
}
- public function testClearCache() {
+ public function testClearCache(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'clearCache'])
->disableOriginalConstructor()
@@ -465,7 +465,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testClearGroupCacheGroupIDNotFound() {
+ public function testClearGroupCacheGroupIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Group id not found in LDAP');
@@ -484,7 +484,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->clearGroupCache('nonexisting_group');
}
- public function testClearGroupCache() {
+ public function testClearGroupCache(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->disableOriginalConstructor()
->getMock();
@@ -509,7 +509,7 @@ class LDAPProviderTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testDnExists() {
+ public function testDnExists(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['dn2UserName'])
->disableOriginalConstructor()
@@ -524,7 +524,7 @@ class LDAPProviderTest extends \Test\TestCase {
$this->assertTrue($ldapProvider->dnExists('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
}
- public function testFlagRecord() {
+ public function testFlagRecord(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods([])
->disableOriginalConstructor()
@@ -537,7 +537,7 @@ class LDAPProviderTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testUnflagRecord() {
+ public function testUnflagRecord(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods([])
->disableOriginalConstructor()
@@ -551,7 +551,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetLDAPDisplayNameFieldUserIDNotFound() {
+ public function testGetLDAPDisplayNameFieldUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -567,7 +567,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getLDAPDisplayNameField('nonexisting_user');
}
- public function testGetLDAPDisplayNameField() {
+ public function testGetLDAPDisplayNameField(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
->disableOriginalConstructor()
@@ -589,7 +589,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetLDAPEmailFieldUserIDNotFound() {
+ public function testGetLDAPEmailFieldUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -605,7 +605,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getLDAPEmailField('nonexisting_user');
}
- public function testGetLDAPEmailField() {
+ public function testGetLDAPEmailField(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
->disableOriginalConstructor()
@@ -627,7 +627,7 @@ class LDAPProviderTest extends \Test\TestCase {
}
- public function testGetLDAPGroupMemberAssocUserIDNotFound() {
+ public function testGetLDAPGroupMemberAssocUserIDNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Group id not found in LDAP');
@@ -648,7 +648,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getLDAPGroupMemberAssoc('nonexisting_group');
}
- public function testgetLDAPGroupMemberAssoc() {
+ public function testgetLDAPGroupMemberAssoc(): void {
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
->disableOriginalConstructor()
->getMock();
@@ -674,7 +674,7 @@ class LDAPProviderTest extends \Test\TestCase {
$this->assertEquals('assoc_type', $ldapProvider->getLDAPGroupMemberAssoc('existing_group'));
}
- public function testGetMultiValueUserAttributeUserNotFound() {
+ public function testGetMultiValueUserAttributeUserNotFound(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('User id not found in LDAP');
@@ -690,7 +690,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getMultiValueUserAttribute('admin', 'mailAlias');
}
- public function testGetMultiValueUserAttributeCacheHit() {
+ public function testGetMultiValueUserAttributeCacheHit(): void {
$connection = $this->createMock(Connection::class);
$connection->expects(self::once())
->method('getFromCache')
@@ -715,7 +715,7 @@ class LDAPProviderTest extends \Test\TestCase {
$ldapProvider->getMultiValueUserAttribute('admin', 'mailAlias');
}
- public function testGetMultiValueUserAttributeLdapError() {
+ public function testGetMultiValueUserAttributeLdapError(): void {
$connection = $this->createMock(Connection::class);
$connection->expects(self::once())
->method('getFromCache')
@@ -752,7 +752,7 @@ class LDAPProviderTest extends \Test\TestCase {
self::assertCount(0, $values);
}
- public function testGetMultiValueUserAttribute() {
+ public function testGetMultiValueUserAttribute(): void {
$connection = $this->createMock(Connection::class);
$connection->expects(self::once())
->method('getFromCache')
@@ -789,7 +789,7 @@ class LDAPProviderTest extends \Test\TestCase {
self::assertCount(2, $values);
}
- public function testGetUserAttributeLdapError() {
+ public function testGetUserAttributeLdapError(): void {
$connection = $this->createMock(Connection::class);
$connection->expects(self::once())
->method('getFromCache')
@@ -826,7 +826,7 @@ class LDAPProviderTest extends \Test\TestCase {
self::assertNull($value);
}
- public function testGetUserAttribute() {
+ public function testGetUserAttribute(): void {
$connection = $this->createMock(Connection::class);
$connection->expects(self::once())
->method('getFromCache')
diff --git a/apps/user_ldap/tests/LDAPTest.php b/apps/user_ldap/tests/LDAPTest.php
index 51ed0c2b462..b7349d11b36 100644
--- a/apps/user_ldap/tests/LDAPTest.php
+++ b/apps/user_ldap/tests/LDAPTest.php
@@ -36,7 +36,7 @@ class LDAPTest extends TestCase {
* @param bool $passThrough
* @dataProvider errorProvider
*/
- public function testSearchWithErrorHandler(string $errorMessage, bool $passThrough) {
+ public function testSearchWithErrorHandler(string $errorMessage, bool $passThrough): void {
$wasErrorHandlerCalled = false;
$errorHandler = function ($number, $message, $file, $line) use (&$wasErrorHandlerCalled) {
$wasErrorHandlerCalled = true;
@@ -59,7 +59,7 @@ class LDAPTest extends TestCase {
restore_error_handler();
}
- public function testModReplace() {
+ public function testModReplace(): void {
$link = $this->createMock(LDAP::class);
$userDN = 'CN=user';
$password = 'MyPassword';
diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
index 478e5ea0395..e0a31c119ba 100644
--- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
+++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php
@@ -16,7 +16,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* kiss test on isColNameValid
*/
- public function testIsColNameValid() {
+ public function testIsColNameValid(): void {
$dbMock = $this->createMock(IDBConnection::class);
$mapper = $this->getMapper($dbMock);
@@ -84,7 +84,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
* tests map() method with input that should result in not-mapping.
* Hint: successful mapping is tested inherently with mapEntries().
*/
- public function testMap() {
+ public function testMap(): void {
[$mapper, $data] = $this->initTest();
// test that mapping will not happen when it shall not
@@ -104,7 +104,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
* tests unmap() for both successful and unsuccessful removing of
* mapping entries
*/
- public function testUnmap() {
+ public function testUnmap(): void {
[$mapper, $data] = $this->initTest();
foreach ($data as $entry) {
@@ -124,7 +124,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
* tests getDNByName(), getNameByDN() and getNameByUUID() for successful
* and unsuccessful requests.
*/
- public function testGetMethods() {
+ public function testGetMethods(): void {
[$mapper, $data] = $this->initTest();
foreach ($data as $entry) {
@@ -152,7 +152,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests getNamesBySearch() for successful and unsuccessful requests.
*/
- public function testSearch() {
+ public function testSearch(): void {
[$mapper,] = $this->initTest();
$names = $mapper->getNamesBySearch('oo', '%', '%');
@@ -168,7 +168,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests setDNbyUUID() for successful and unsuccessful update.
*/
- public function testSetDNMethod() {
+ public function testSetDNMethod(): void {
[$mapper, $data] = $this->initTest();
$newDN = 'uid=modified,dc=example,dc=org';
@@ -187,7 +187,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests setUUIDbyDN() for successful and unsuccessful update.
*/
- public function testSetUUIDMethod() {
+ public function testSetUUIDMethod(): void {
/** @var AbstractMapping $mapper */
[$mapper, $data] = $this->initTest();
@@ -207,7 +207,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests clear() for successful update.
*/
- public function testClear() {
+ public function testClear(): void {
[$mapper, $data] = $this->initTest();
$done = $mapper->clear();
@@ -221,7 +221,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests clear() for successful update.
*/
- public function testClearCb() {
+ public function testClearCb(): void {
[$mapper, $data] = $this->initTest();
$callbackCalls = 0;
@@ -244,7 +244,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
/**
* tests getList() method
*/
- public function testList() {
+ public function testList(): void {
[$mapper, $data] = $this->initTest();
// get all entries without specifying offset or limit
@@ -265,7 +265,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
$this->assertSame(1, count($results));
}
- public function testGetListOfIdsByDn() {
+ public function testGetListOfIdsByDn(): void {
/** @var AbstractMapping $mapper */
[$mapper,] = $this->initTest();
diff --git a/apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php b/apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php
index 9d433cf4937..f8abcaeb482 100644
--- a/apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php
+++ b/apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php
@@ -48,7 +48,7 @@ abstract class AbstractUUIDFixTest extends TestCase {
->willReturn($this->access);
}
- public function testRunSingleRecord() {
+ public function testRunSingleRecord(): void {
$args = [
'records' => [
0 => [
@@ -72,7 +72,7 @@ abstract class AbstractUUIDFixTest extends TestCase {
$this->job->run($args);
}
- public function testRunValidRecord() {
+ public function testRunValidRecord(): void {
$correctUUID = '4355-AED3-9D73-03AD';
$args = [
'records' => [
@@ -95,7 +95,7 @@ abstract class AbstractUUIDFixTest extends TestCase {
$this->job->run($args);
}
- public function testRunRemovedRecord() {
+ public function testRunRemovedRecord(): void {
$args = [
'records' => [
0 => [
@@ -117,7 +117,7 @@ abstract class AbstractUUIDFixTest extends TestCase {
$this->job->run($args);
}
- public function testRunManyRecords() {
+ public function testRunManyRecords(): void {
$args = [
'records' => [
0 => [
diff --git a/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php b/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php
index 78d119bf566..f31da43c584 100644
--- a/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php
+++ b/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php
@@ -44,7 +44,7 @@ class UUIDFixInsertTest extends TestCase {
);
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertSame('Insert UUIDFix background job for user and group in batches', $this->job->getName());
}
@@ -97,7 +97,7 @@ class UUIDFixInsertTest extends TestCase {
/**
* @dataProvider recordProvider
*/
- public function testRun($userBatches, $groupBatches) {
+ public function testRun($userBatches, $groupBatches): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('user_ldap', 'installed_version', '1.2.1')
@@ -124,7 +124,7 @@ class UUIDFixInsertTest extends TestCase {
/**
* @dataProvider recordProviderTooLongAndNone
*/
- public function testRunWithManyAndNone($userBatches, $groupBatches) {
+ public function testRunWithManyAndNone($userBatches, $groupBatches): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('user_ldap', 'installed_version', '1.2.1')
@@ -155,7 +155,7 @@ class UUIDFixInsertTest extends TestCase {
$this->job->run($out);
}
- public function testDonNotRun() {
+ public function testDonNotRun(): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('user_ldap', 'installed_version', '1.2.1')
diff --git a/apps/user_ldap/tests/Settings/AdminTest.php b/apps/user_ldap/tests/Settings/AdminTest.php
index 7906a07c3e9..e06563d1856 100644
--- a/apps/user_ldap/tests/Settings/AdminTest.php
+++ b/apps/user_ldap/tests/Settings/AdminTest.php
@@ -34,7 +34,7 @@ class AdminTest extends TestCase {
/**
* @UseDB
*/
- public function testGetForm() {
+ public function testGetForm(): void {
$prefixes = ['s01'];
$hosts = ['s01' => ''];
@@ -59,11 +59,11 @@ class AdminTest extends TestCase {
$this->assertEquals($expected, $this->admin->getForm());
}
- public function testGetSection() {
+ public function testGetSection(): void {
$this->assertSame('ldap', $this->admin->getSection());
}
- public function testGetPriority() {
+ public function testGetPriority(): void {
$this->assertSame(5, $this->admin->getPriority());
}
}
diff --git a/apps/user_ldap/tests/Settings/SectionTest.php b/apps/user_ldap/tests/Settings/SectionTest.php
index 5fe5476f1c3..722581713d1 100644
--- a/apps/user_ldap/tests/Settings/SectionTest.php
+++ b/apps/user_ldap/tests/Settings/SectionTest.php
@@ -29,11 +29,11 @@ class SectionTest extends TestCase {
);
}
- public function testGetID() {
+ public function testGetID(): void {
$this->assertSame('ldap', $this->section->getID());
}
- public function testGetName() {
+ public function testGetName(): void {
$this->l
->expects($this->once())
->method('t')
@@ -43,11 +43,11 @@ class SectionTest extends TestCase {
$this->assertSame('LDAP/AD integration', $this->section->getName());
}
- public function testGetPriority() {
+ public function testGetPriority(): void {
$this->assertSame(25, $this->section->getPriority());
}
- public function testGetIcon() {
+ public function testGetIcon(): void {
$this->url->expects($this->once())
->method('imagePath')
->with('user_ldap', 'app-dark.svg')
diff --git a/apps/user_ldap/tests/User/DeletedUsersIndexTest.php b/apps/user_ldap/tests/User/DeletedUsersIndexTest.php
index 32fa5bc38bf..0e77f5023d5 100644
--- a/apps/user_ldap/tests/User/DeletedUsersIndexTest.php
+++ b/apps/user_ldap/tests/User/DeletedUsersIndexTest.php
@@ -54,7 +54,7 @@ class DeletedUsersIndexTest extends \Test\TestCase {
parent::tearDown();
}
- public function testMarkAndFetchUser() {
+ public function testMarkAndFetchUser(): void {
$uids = [
'cef3775c-71d2-48eb-8984-39a4051b0b95',
'8c4bbb40-33ed-42d0-9b14-85b0ab76c1cc',
@@ -82,7 +82,7 @@ class DeletedUsersIndexTest extends \Test\TestCase {
$this->assertEmpty($uids);
}
- public function testUnmarkUser() {
+ public function testUnmarkUser(): void {
$uids = [
'22a162c7-a9ee-487c-9f33-0563795583fb',
'1fb4e0da-4a75-47f3-8fa7-becc7e35c9c5',
diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php
index 597a2e69a0a..449f159ec4d 100644
--- a/apps/user_ldap/tests/User/ManagerTest.php
+++ b/apps/user_ldap/tests/User/ManagerTest.php
@@ -114,7 +114,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider dnProvider
*/
- public function testGetByDNExisting(string $inputDN) {
+ public function testGetByDNExisting(string $inputDN): void {
$uid = '563418fc-423b-1033-8d1c-ad5f418ee02e';
$this->access->expects($this->once())
@@ -139,7 +139,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertInstanceOf(User::class, $user);
}
- public function testGetByDNNotExisting() {
+ public function testGetByDNNotExisting(): void {
$inputDN = 'cn=gone,dc=foobar,dc=bar';
$this->access->expects($this->once())
@@ -161,7 +161,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($user);
}
- public function testGetByUidExisting() {
+ public function testGetByUidExisting(): void {
$dn = 'cn=foo,dc=foobar,dc=bar';
$uid = '563418fc-423b-1033-8d1c-ad5f418ee02e';
@@ -187,7 +187,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertInstanceOf(User::class, $user);
}
- public function testGetByUidNotExisting() {
+ public function testGetByUidNotExisting(): void {
$uid = 'gone';
$this->access->expects($this->never())
@@ -213,7 +213,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider attributeRequestProvider
*/
- public function testGetAttributes($minimal) {
+ public function testGetAttributes($minimal): void {
$this->connection->setConfiguration([
'ldapEmailAttribute' => 'MAIL',
'ldapUserAvatarRule' => 'default',
diff --git a/apps/user_ldap/tests/User/OfflineUserTest.php b/apps/user_ldap/tests/User/OfflineUserTest.php
index 8ac0e617d80..e53bfca7f47 100644
--- a/apps/user_ldap/tests/User/OfflineUserTest.php
+++ b/apps/user_ldap/tests/User/OfflineUserTest.php
@@ -55,7 +55,7 @@ class OfflineUserTest extends TestCase {
/**
* @dataProvider shareOwnerProvider
*/
- public function testHasActiveShares(array $existingShareTypes, bool $expected) {
+ public function testHasActiveShares(array $existingShareTypes, bool $expected): void {
$shareMock = $this->createMock(IShare::class);
$this->shareManager->expects($this->atLeastOnce())
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php
index 1d4aeb619b6..aca4e2434e2 100644
--- a/apps/user_ldap/tests/User/UserTest.php
+++ b/apps/user_ldap/tests/User/UserTest.php
@@ -87,12 +87,12 @@ class UserTest extends \Test\TestCase {
);
}
- public function testGetDNandUsername() {
+ public function testGetDNandUsername(): void {
$this->assertSame($this->dn, $this->user->getDN());
$this->assertSame($this->uid, $this->user->getUsername());
}
- public function testUpdateEmailProvided() {
+ public function testUpdateEmailProvided(): void {
$this->connection->expects($this->once())
->method('__get')
->with($this->equalTo('ldapEmailAttribute'))
@@ -118,7 +118,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateEmail();
}
- public function testUpdateEmailNotProvided() {
+ public function testUpdateEmailNotProvided(): void {
$this->connection->expects($this->once())
->method('__get')
->with($this->equalTo('ldapEmailAttribute'))
@@ -136,7 +136,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateEmail();
}
- public function testUpdateEmailNotConfigured() {
+ public function testUpdateEmailNotConfigured(): void {
$this->connection->expects($this->once())
->method('__get')
->with($this->equalTo('ldapEmailAttribute'))
@@ -151,7 +151,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateEmail();
}
- public function testUpdateQuotaAllProvided() {
+ public function testUpdateQuotaAllProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -178,7 +178,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaToDefaultAllProvided() {
+ public function testUpdateQuotaToDefaultAllProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -205,7 +205,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaToNoneAllProvided() {
+ public function testUpdateQuotaToNoneAllProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -232,7 +232,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaDefaultProvided() {
+ public function testUpdateQuotaDefaultProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -259,7 +259,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaIndividualProvided() {
+ public function testUpdateQuotaIndividualProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -286,7 +286,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaNoneProvided() {
+ public function testUpdateQuotaNoneProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -314,7 +314,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaNoneConfigured() {
+ public function testUpdateQuotaNoneConfigured(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -338,7 +338,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateQuota();
}
- public function testUpdateQuotaFromValue() {
+ public function testUpdateQuotaFromValue(): void {
$readQuota = '19 GB';
$this->connection->expects($this->exactly(2))
@@ -367,7 +367,7 @@ class UserTest extends \Test\TestCase {
/**
* Unparseable quota will fallback to use the LDAP default
*/
- public function testUpdateWrongQuotaAllProvided() {
+ public function testUpdateWrongQuotaAllProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -397,7 +397,7 @@ class UserTest extends \Test\TestCase {
/**
* No user quota and wrong default will set 'default' as quota
*/
- public function testUpdateWrongDefaultQuotaProvided() {
+ public function testUpdateWrongDefaultQuotaProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -424,7 +424,7 @@ class UserTest extends \Test\TestCase {
/**
* Wrong user quota and wrong default will set 'default' as quota
*/
- public function testUpdateWrongQuotaAndDefaultAllProvided() {
+ public function testUpdateWrongQuotaAndDefaultAllProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -451,7 +451,7 @@ class UserTest extends \Test\TestCase {
/**
* No quota attribute set and wrong default will set 'default' as quota
*/
- public function testUpdateWrongDefaultQuotaNotProvided() {
+ public function testUpdateWrongDefaultQuotaNotProvided(): void {
$this->connection->expects($this->exactly(2))
->method('__get')
->willReturnMap([
@@ -529,7 +529,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateAvatar();
}
- public function testUpdateAvatarKnownJpegPhotoProvided() {
+ public function testUpdateAvatarKnownJpegPhotoProvided(): void {
$this->access->expects($this->once())
->method('readAttribute')
->with($this->equalTo($this->dn),
@@ -647,7 +647,7 @@ class UserTest extends \Test\TestCase {
$this->user->updateAvatar();
}
- public function testUpdateAvatarCorruptPhotoProvided() {
+ public function testUpdateAvatarCorruptPhotoProvided(): void {
$this->access->expects($this->any())
->method('readAttribute')
->willReturnCallback(function ($dn, $attr) {
@@ -761,7 +761,7 @@ class UserTest extends \Test\TestCase {
$this->assertFalse($this->user->updateAvatar());
}
- public function testUpdateAvatarNotProvided() {
+ public function testUpdateAvatarNotProvided(): void {
$this->access->expects($this->any())
->method('readAttribute')
->willReturnCallback(function ($dn, $attr) {
@@ -816,7 +816,7 @@ class UserTest extends \Test\TestCase {
/**
* @dataProvider extStorageHomeDataProvider
*/
- public function testUpdateExtStorageHome(string $expected, ?string $valueFromLDAP = null, bool $isSet = true) {
+ public function testUpdateExtStorageHome(string $expected, ?string $valueFromLDAP = null, bool $isSet = true): void {
if ($valueFromLDAP === null) {
$this->connection->expects($this->once())
->method('__get')
@@ -848,7 +848,7 @@ class UserTest extends \Test\TestCase {
$this->assertSame($expected, $actual);
}
- public function testMarkLogin() {
+ public function testMarkLogin(): void {
$this->config->expects($this->once())
->method('setUserValue')
->with($this->equalTo($this->uid),
@@ -860,7 +860,7 @@ class UserTest extends \Test\TestCase {
$this->user->markLogin();
}
- public function testGetAvatarImageProvided() {
+ public function testGetAvatarImageProvided(): void {
$this->access->expects($this->once())
->method('readAttribute')
->with($this->equalTo($this->dn),
@@ -878,7 +878,7 @@ class UserTest extends \Test\TestCase {
$this->user->getAvatarImage();
}
- public function testGetAvatarImageDisabled() {
+ public function testGetAvatarImageDisabled(): void {
$this->access->expects($this->never())
->method('readAttribute')
->with($this->equalTo($this->dn), $this->anything());
@@ -898,7 +898,7 @@ class UserTest extends \Test\TestCase {
];
}
- public function testProcessAttributes() {
+ public function testProcessAttributes(): void {
$requiredMethods = [
'updateQuota',
'updateEmail',
@@ -973,7 +973,7 @@ class UserTest extends \Test\TestCase {
/**
* @dataProvider emptyHomeFolderAttributeValueProvider
*/
- public function testGetHomePathNotConfigured($attributeValue) {
+ public function testGetHomePathNotConfigured($attributeValue): void {
$this->connection->expects($this->any())
->method('__get')
->with($this->equalTo('homeFolderNamingRule'))
@@ -989,7 +989,7 @@ class UserTest extends \Test\TestCase {
$this->assertFalse($this->user->getHomePath());
}
- public function testGetHomePathConfiguredNotAvailableAllowed() {
+ public function testGetHomePathConfiguredNotAvailableAllowed(): void {
$this->connection->expects($this->any())
->method('__get')
->with($this->equalTo('homeFolderNamingRule'))
@@ -1013,7 +1013,7 @@ class UserTest extends \Test\TestCase {
}
- public function testGetHomePathConfiguredNotAvailableNotAllowed() {
+ public function testGetHomePathConfiguredNotAvailableNotAllowed(): void {
$this->expectException(\Exception::class);
$this->connection->expects($this->any())
@@ -1050,7 +1050,7 @@ class UserTest extends \Test\TestCase {
/**
* @dataProvider displayNameProvider
*/
- public function testComposeAndStoreDisplayName($part1, $part2, $expected, $expectTriggerChange) {
+ public function testComposeAndStoreDisplayName($part1, $part2, $expected, $expectTriggerChange): void {
$this->config->expects($this->once())
->method('setUserValue');
$oldName = $expectTriggerChange ? 'xxGunslingerxx' : null;
@@ -1076,7 +1076,7 @@ class UserTest extends \Test\TestCase {
$this->assertSame($expected, $displayName);
}
- public function testComposeAndStoreDisplayNameNoOverwrite() {
+ public function testComposeAndStoreDisplayNameNoOverwrite(): void {
$displayName = 'Randall Flagg';
$this->config->expects($this->never())
->method('setUserValue');
@@ -1091,7 +1091,7 @@ class UserTest extends \Test\TestCase {
$this->assertSame($composedDisplayName, $displayName);
}
- public function testHandlePasswordExpiryWarningDefaultPolicy() {
+ public function testHandlePasswordExpiryWarningDefaultPolicy(): void {
$this->connection->expects($this->any())
->method('__get')
->willReturnCallback(function ($name) {
@@ -1154,7 +1154,7 @@ class UserTest extends \Test\TestCase {
\OC_Hook::emit('OC_User', 'post_login', ['uid' => $this->uid]);
}
- public function testHandlePasswordExpiryWarningCustomPolicy() {
+ public function testHandlePasswordExpiryWarningCustomPolicy(): void {
$this->connection->expects($this->any())
->method('__get')
->willReturnCallback(function ($name) {
diff --git a/apps/user_ldap/tests/UserLDAPPluginTest.php b/apps/user_ldap/tests/UserLDAPPluginTest.php
index 1e3cd6afbf8..5f11f817771 100644
--- a/apps/user_ldap/tests/UserLDAPPluginTest.php
+++ b/apps/user_ldap/tests/UserLDAPPluginTest.php
@@ -17,7 +17,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
return new UserPluginManager();
}
- public function testImplementsActions() {
+ public function testImplementsActions(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -44,7 +44,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$this->assertTrue($pluginManager->implementsActions(Backend::PROVIDE_AVATAR));
}
- public function testCreateUser() {
+ public function testCreateUser(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -67,7 +67,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testCreateUserNotRegistered() {
+ public function testCreateUserNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements createUser in this LDAP Backend.');
@@ -75,7 +75,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->createUser('foo', 'bar');
}
- public function testSetPassword() {
+ public function testSetPassword(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -98,7 +98,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testSetPasswordNotRegistered() {
+ public function testSetPasswordNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements setPassword in this LDAP Backend.');
@@ -106,7 +106,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->setPassword('foo', 'bar');
}
- public function testGetHome() {
+ public function testGetHome(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -128,7 +128,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testGetHomeNotRegistered() {
+ public function testGetHomeNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements getHome in this LDAP Backend.');
@@ -136,7 +136,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->getHome('foo');
}
- public function testGetDisplayName() {
+ public function testGetDisplayName(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -158,7 +158,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testGetDisplayNameNotRegistered() {
+ public function testGetDisplayNameNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements getDisplayName in this LDAP Backend.');
@@ -166,7 +166,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->getDisplayName('foo');
}
- public function testSetDisplayName() {
+ public function testSetDisplayName(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -189,7 +189,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testSetDisplayNameNotRegistered() {
+ public function testSetDisplayNameNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements setDisplayName in this LDAP Backend.');
@@ -197,7 +197,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->setDisplayName('foo', 'bar');
}
- public function testCanChangeAvatar() {
+ public function testCanChangeAvatar(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -219,7 +219,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testCanChangeAvatarNotRegistered() {
+ public function testCanChangeAvatarNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements canChangeAvatar in this LDAP Backend.');
@@ -227,7 +227,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->canChangeAvatar('foo');
}
- public function testCountUsers() {
+ public function testCountUsers(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -246,7 +246,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testCountUsersNotRegistered() {
+ public function testCountUsersNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements countUsers in this LDAP Backend.');
@@ -254,7 +254,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
$pluginManager->countUsers();
}
- public function testDeleteUser() {
+ public function testDeleteUser(): void {
$pluginManager = $this->getUserPluginManager();
$plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy')
@@ -282,7 +282,7 @@ class UserLDAPPluginTest extends \Test\TestCase {
}
- public function testDeleteUserNotRegistered() {
+ public function testDeleteUserNotRegistered(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No plugin implements deleteUser in this LDAP Backend.');
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 8d6a56112ce..90166beccff 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -170,7 +170,7 @@ class User_LDAPTest extends TestCase {
->willReturn(['dn', 'uid', 'mail', 'displayname']);
}
- public function testCheckPasswordUidReturn() {
+ public function testCheckPasswordUidReturn(): void {
$user = $this->createMock(User::class);
$user->expects($this->any())
->method('getUsername')
@@ -189,7 +189,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals('gunslinger', $result);
}
- public function testCheckPasswordWrongPassword() {
+ public function testCheckPasswordWrongPassword(): void {
$this->prepareAccessForCheckPassword();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -198,7 +198,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testCheckPasswordWrongUser() {
+ public function testCheckPasswordWrongUser(): void {
$this->prepareAccessForCheckPassword();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -207,7 +207,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testCheckPasswordNoDisplayName() {
+ public function testCheckPasswordNoDisplayName(): void {
$this->prepareAccessForCheckPassword(true);
$this->prepareAccessForCheckPassword();
@@ -222,7 +222,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testCheckPasswordPublicAPI() {
+ public function testCheckPasswordPublicAPI(): void {
$user = $this->createMock(User::class);
$user->expects($this->any())
->method('getUsername')
@@ -244,7 +244,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals('gunslinger', $result);
}
- public function testCheckPasswordPublicAPIWrongPassword() {
+ public function testCheckPasswordPublicAPIWrongPassword(): void {
$this->prepareAccessForCheckPassword();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -257,7 +257,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testCheckPasswordPublicAPIWrongUser() {
+ public function testCheckPasswordPublicAPIWrongUser(): void {
$this->prepareAccessForCheckPassword();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -270,13 +270,13 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testDeleteUserCancel() {
+ public function testDeleteUserCancel(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$result = $backend->deleteUser('notme');
$this->assertFalse($result);
}
- public function testDeleteUserSuccess() {
+ public function testDeleteUserSuccess(): void {
$uid = 'jeremy';
$home = '/var/vhome/jdings/';
@@ -316,7 +316,7 @@ class User_LDAPTest extends TestCase {
$this->assertSame($backend->getHome($uid), $home);
}
- public function testDeleteUserWithPlugin() {
+ public function testDeleteUserWithPlugin(): void {
$this->pluginManager->expects($this->once())
->method('canDeleteUser')
->willReturn(true);
@@ -395,7 +395,7 @@ class User_LDAPTest extends TestCase {
->willReturn(['dn', 'uid', 'mail', 'displayname']);
}
- public function testGetUsersNoParam() {
+ public function testGetUsersNoParam(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -403,7 +403,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(3, count($result));
}
- public function testGetUsersLimitOffset() {
+ public function testGetUsersLimitOffset(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -411,7 +411,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(1, count($result));
}
- public function testGetUsersLimitOffset2() {
+ public function testGetUsersLimitOffset2(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -419,7 +419,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(2, count($result));
}
- public function testGetUsersSearchWithResult() {
+ public function testGetUsersSearchWithResult(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -427,7 +427,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(2, count($result));
}
- public function testGetUsersSearchEmptyResult() {
+ public function testGetUsersSearchEmptyResult(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -443,7 +443,7 @@ class User_LDAPTest extends TestCase {
return $uids;
}
- public function testGetUsersViaAPINoParam() {
+ public function testGetUsersViaAPINoParam(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -452,7 +452,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(3, count($result));
}
- public function testGetUsersViaAPILimitOffset() {
+ public function testGetUsersViaAPILimitOffset(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -461,7 +461,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(1, count($result));
}
- public function testGetUsersViaAPILimitOffset2() {
+ public function testGetUsersViaAPILimitOffset2(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -470,7 +470,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(2, count($result));
}
- public function testGetUsersViaAPISearchWithResult() {
+ public function testGetUsersViaAPISearchWithResult(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -479,7 +479,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(2, count($result));
}
- public function testGetUsersViaAPISearchEmptyResult() {
+ public function testGetUsersViaAPISearchEmptyResult(): void {
$this->prepareAccessForGetUsers();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
\OC_User::useBackend($backend);
@@ -488,7 +488,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(0, count($result));
}
- public function testUserExists() {
+ public function testUserExists(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
@@ -510,7 +510,7 @@ class User_LDAPTest extends TestCase {
$this->assertTrue($result);
}
- public function testUserExistsForDeleted() {
+ public function testUserExistsForDeleted(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
@@ -535,7 +535,7 @@ class User_LDAPTest extends TestCase {
$this->assertTrue($backend->userExists('formerUser'));
}
- public function testUserExistsForNeverExisting() {
+ public function testUserExistsForNeverExisting(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
@@ -554,7 +554,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testUserExistsPublicAPI() {
+ public function testUserExistsPublicAPI(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
\OC_User::useBackend($backend);
@@ -587,7 +587,7 @@ class User_LDAPTest extends TestCase {
$this->assertTrue($result);
}
- public function testDeleteUserExisting() {
+ public function testDeleteUserExisting(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
//we do not support deleting existing users at all
@@ -595,7 +595,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testGetHomeAbsolutePath() {
+ public function testGetHomeAbsolutePath(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
@@ -649,7 +649,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals('/tmp/rolandshome/', $result);
}
- public function testGetHomeRelative() {
+ public function testGetHomeRelative(): void {
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
@@ -705,7 +705,7 @@ class User_LDAPTest extends TestCase {
}
- public function testGetHomeNoPath() {
+ public function testGetHomeNoPath(): void {
$this->expectException(\Exception::class);
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -750,7 +750,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testGetHomeDeletedUser() {
+ public function testGetHomeDeletedUser(): void {
$uid = 'newyorker';
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
@@ -793,7 +793,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testGetHomeWithPlugin() {
+ public function testGetHomeWithPlugin(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::GET_HOME)
@@ -844,7 +844,7 @@ class User_LDAPTest extends TestCase {
->willReturn([]);
}
- public function testGetDisplayName() {
+ public function testGetDisplayName(): void {
$this->prepareAccessForGetDisplayName();
$backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex);
$this->prepareMockForUserExists();
@@ -915,7 +915,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(null, $result);
}
- public function testGetDisplayNamePublicAPI() {
+ public function testGetDisplayNamePublicAPI(): void {
$this->access->expects($this->any())
->method('username2dn')
->willReturnCallback(function ($uid) {
@@ -1008,7 +1008,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals('newyorker', $result);
}
- public function testGetDisplayNameWithPlugin() {
+ public function testGetDisplayNameWithPlugin(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::GET_DISPLAYNAME)
@@ -1024,7 +1024,7 @@ class User_LDAPTest extends TestCase {
//no test for getDisplayNames, because it just invokes getUsers and
//getDisplayName
- public function testCountUsers() {
+ public function testCountUsers(): void {
$this->access->expects($this->once())
->method('countUsers')
->willReturn(5);
@@ -1035,7 +1035,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(5, $result);
}
- public function testCountUsersFailing() {
+ public function testCountUsersFailing(): void {
$this->access->expects($this->once())
->method('countUsers')
->willReturn(false);
@@ -1046,7 +1046,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($result);
}
- public function testCountUsersWithPlugin() {
+ public function testCountUsersWithPlugin(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::COUNT_USERS)
@@ -1058,7 +1058,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals($this->backend->countUsers(), 42);
}
- public function testLoginName2UserNameSuccess() {
+ public function testLoginName2UserNameSuccess(): void {
$loginName = 'Alice';
$username = 'alice';
$dn = 'uid=alice,dc=what,dc=ever';
@@ -1107,7 +1107,7 @@ class User_LDAPTest extends TestCase {
$backend->loginName2UserName($loginName);
}
- public function testLoginName2UserNameNoUsersOnLDAP() {
+ public function testLoginName2UserNameNoUsersOnLDAP(): void {
$loginName = 'Loki';
$this->access->expects($this->once())
@@ -1139,7 +1139,7 @@ class User_LDAPTest extends TestCase {
$backend->loginName2UserName($loginName);
}
- public function testLoginName2UserNameOfflineUser() {
+ public function testLoginName2UserNameOfflineUser(): void {
$loginName = 'Alice';
$dn = 'uid=alice,dc=what,dc=ever';
@@ -1237,7 +1237,7 @@ class User_LDAPTest extends TestCase {
}
- public function testSetPasswordInvalid() {
+ public function testSetPasswordInvalid(): void {
$this->expectException(\OCP\HintException::class);
$this->expectExceptionMessage('Password fails quality checking policy');
@@ -1251,7 +1251,7 @@ class User_LDAPTest extends TestCase {
$this->assertTrue(\OC_User::setPassword('roland', 'dt'));
}
- public function testSetPasswordValid() {
+ public function testSetPasswordValid(): void {
$this->prepareAccessForSetPassword($this->access);
$this->userManager->expects($this->any())
@@ -1268,7 +1268,7 @@ class User_LDAPTest extends TestCase {
$this->assertTrue(\OC_User::setPassword('roland', 'dt12234$'));
}
- public function testSetPasswordValidDisabled() {
+ public function testSetPasswordValidDisabled(): void {
$this->userManager->expects($this->any())
->method('get')
->willReturn($this->createMock(User::class));
@@ -1281,7 +1281,7 @@ class User_LDAPTest extends TestCase {
}
- public function testSetPasswordWithInvalidUser() {
+ public function testSetPasswordWithInvalidUser(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('LDAP setPassword: Could not get user object for uid NotExistingUser. Maybe the LDAP entry has no set display name attribute?');
@@ -1294,7 +1294,7 @@ class User_LDAPTest extends TestCase {
$this->backend->setPassword('NotExistingUser', 'Password');
}
- public function testSetPasswordWithUsernameFalse() {
+ public function testSetPasswordWithUsernameFalse(): void {
$user = $this->createMock(User::class);
$user
->expects($this->once())
@@ -1310,7 +1310,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($this->backend->setPassword('NotExistingUser', 'Password'));
}
- public function testSetPasswordWithPlugin() {
+ public function testSetPasswordWithPlugin(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::SET_PASSWORD)
@@ -1333,7 +1333,7 @@ class User_LDAPTest extends TestCase {
}
/** @dataProvider avatarDataProvider */
- public function testCanChangeAvatar($imageData, $expected) {
+ public function testCanChangeAvatar($imageData, $expected): void {
$isValidImage = str_starts_with((string)$imageData, 'valid');
$user = $this->createMock(User::class);
@@ -1352,7 +1352,7 @@ class User_LDAPTest extends TestCase {
$this->assertSame($expected, $this->backend->canChangeAvatar('uid'));
}
- public function testCanChangeAvatarWithPlugin() {
+ public function testCanChangeAvatarWithPlugin(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::PROVIDE_AVATAR)
@@ -1365,7 +1365,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals($this->backend->canChangeAvatar('uid'), 'result');
}
- public function testSetDisplayNameWithPlugin() {
+ public function testSetDisplayNameWithPlugin(): void {
$newDisplayName = 'J. Baker';
$this->pluginManager->expects($this->once())
->method('implementsActions')
@@ -1382,7 +1382,7 @@ class User_LDAPTest extends TestCase {
}
- public function testSetDisplayNameErrorWithPlugin() {
+ public function testSetDisplayNameErrorWithPlugin(): void {
$this->expectException(\OCP\HintException::class);
$newDisplayName = 'J. Baker';
@@ -1400,7 +1400,7 @@ class User_LDAPTest extends TestCase {
$this->backend->setDisplayName('uid', $newDisplayName);
}
- public function testSetDisplayNameFailing() {
+ public function testSetDisplayNameFailing(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::SET_DISPLAYNAME)
@@ -1411,7 +1411,7 @@ class User_LDAPTest extends TestCase {
$this->assertFalse($this->backend->setDisplayName('uid', 'displayName'));
}
- public function testCreateUserWithPlugin() {
+ public function testCreateUserWithPlugin(): void {
$uid = 'alien6372';
$uuid = '123-2345-36756-123-2345234-4431';
$pwd = 'passwørd';
@@ -1438,7 +1438,7 @@ class User_LDAPTest extends TestCase {
$this->assertEquals($this->backend->createUser($uid, $pwd), true);
}
- public function testCreateUserFailing() {
+ public function testCreateUserFailing(): void {
$this->pluginManager->expects($this->once())
->method('implementsActions')
->with(Backend::CREATE_USER)
@@ -1460,7 +1460,7 @@ class User_LDAPTest extends TestCase {
/**
* @dataProvider actionProvider
*/
- public function testImplementsAction($configurable, $value, $actionCode, $expected) {
+ public function testImplementsAction($configurable, $value, $actionCode, $expected): void {
$this->pluginManager->expects($this->once())
->method('getImplementedActions')
->willReturn(0);
diff --git a/apps/user_ldap/tests/User_ProxyTest.php b/apps/user_ldap/tests/User_ProxyTest.php
index 5af7fef3f00..4544276a714 100644
--- a/apps/user_ldap/tests/User_ProxyTest.php
+++ b/apps/user_ldap/tests/User_ProxyTest.php
@@ -58,7 +58,7 @@ class User_ProxyTest extends TestCase {
->getMock();
}
- public function testSetPassword() {
+ public function testSetPassword(): void {
$this->proxy
->expects($this->once())
->method('handleRequest')
@@ -68,7 +68,7 @@ class User_ProxyTest extends TestCase {
$this->assertTrue($this->proxy->setPassword('MyUid', 'MyPassword'));
}
- public function testSetDisplayName() {
+ public function testSetDisplayName(): void {
$this->proxy
->expects($this->once())
->method('handleRequest')
@@ -78,7 +78,7 @@ class User_ProxyTest extends TestCase {
$this->assertTrue($this->proxy->setDisplayName('MyUid', 'MyPassword'));
}
- public function testCreateUser() {
+ public function testCreateUser(): void {
$this->proxy
->expects($this->once())
->method('handleRequest')
diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php
index d3cf6ffb0ae..31fd28e2fa1 100644
--- a/apps/user_ldap/tests/WizardTest.php
+++ b/apps/user_ldap/tests/WizardTest.php
@@ -75,7 +75,7 @@ class WizardTest extends TestCase {
->willReturn(true);
}
- public function testCumulativeSearchOnAttributeLimited() {
+ public function testCumulativeSearchOnAttributeLimited(): void {
[$wizard, $configuration, $ldap] = $this->getWizardAndMocks();
$configuration->expects($this->any())
@@ -135,7 +135,7 @@ class WizardTest extends TestCase {
unset($uidnumber);
}
- public function testCumulativeSearchOnAttributeUnlimited() {
+ public function testCumulativeSearchOnAttributeUnlimited(): void {
[$wizard, $configuration, $ldap] = $this->getWizardAndMocks();
$configuration->expects($this->any())
@@ -211,7 +211,7 @@ class WizardTest extends TestCase {
unset($uidnumber);
}
- public function testDetectEmailAttributeAlreadySet() {
+ public function testDetectEmailAttributeAlreadySet(): void {
[$wizard, $configuration, $ldap, $access]
= $this->getWizardAndMocks();
@@ -233,7 +233,7 @@ class WizardTest extends TestCase {
$wizard->detectEmailAttribute();
}
- public function testDetectEmailAttributeOverrideSet() {
+ public function testDetectEmailAttributeOverrideSet(): void {
[$wizard, $configuration, $ldap, $access]
= $this->getWizardAndMocks();
@@ -272,7 +272,7 @@ class WizardTest extends TestCase {
$result['changes']['ldap_email_attr']);
}
- public function testDetectEmailAttributeFind() {
+ public function testDetectEmailAttributeFind(): void {
[$wizard, $configuration, $ldap, $access]
= $this->getWizardAndMocks();
@@ -311,7 +311,7 @@ class WizardTest extends TestCase {
$result['changes']['ldap_email_attr']);
}
- public function testDetectEmailAttributeFindNothing() {
+ public function testDetectEmailAttributeFindNothing(): void {
[$wizard, $configuration, $ldap, $access]
= $this->getWizardAndMocks();
@@ -349,7 +349,7 @@ class WizardTest extends TestCase {
$this->assertSame(false, $result->hasChanges());
}
- public function testCumulativeSearchOnAttributeSkipReadDN() {
+ public function testCumulativeSearchOnAttributeSkipReadDN(): void {
// tests that there is no infinite loop, when skipping already processed
// DNs (they can be returned multiple times for multiple filters )
[$wizard, $configuration, $ldap] = $this->getWizardAndMocks();