diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-10-05 15:12:57 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-10-05 20:25:24 +0200 |
commit | d9015a8c94bfd71fe484618a06d276701d3bf9ff (patch) | |
tree | 3f7a1cd6ec2fd982dd02de71b76076f7f01cef70 /apps/user_ldap/tests | |
parent | d357f4b10fe1b59e1e07bb90641d647522c7bfe2 (diff) | |
download | nextcloud-server-d9015a8c94bfd71fe484618a06d276701d3bf9ff.tar.gz nextcloud-server-d9015a8c94bfd71fe484618a06d276701d3bf9ff.zip |
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/user_ldap/tests')
13 files changed, 32 insertions, 32 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 549f6600b4d..d01cd80b3a0 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -84,7 +84,7 @@ class AccessTest extends TestCase { $this->ldap = $this->createMock(LDAP::class); $this->userManager = $this->createMock(Manager::class); $this->helper = $this->createMock(Helper::class); - $this->config = $this->createMock(IConfig::class); + $this->config = $this->createMock(IConfig::class); $this->userMapper = $this->createMock(UserMapping::class); $this->ncUserManager = $this->createMock(IUserManager::class); @@ -100,7 +100,7 @@ class AccessTest extends TestCase { } private function getConnectorAndLdapMock() { - $lw = $this->createMock(ILDAPWrapper::class); + $lw = $this->createMock(ILDAPWrapper::class); $connector = $this->getMockBuilder(Connection::class) ->setConstructorArgs([$lw, null, null]) ->getMock(); diff --git a/apps/user_ldap/tests/ConfigurationTest.php b/apps/user_ldap/tests/ConfigurationTest.php index db119eb3bfe..6239bab68b0 100644 --- a/apps/user_ldap/tests/ConfigurationTest.php +++ b/apps/user_ldap/tests/ConfigurationTest.php @@ -74,23 +74,23 @@ class ConfigurationTest extends \Test\TestCase { return [ 'set general base' => ['ldapBase', $inputWithDN, $expectWithDN], - 'set user base' => ['ldapBaseUsers', $inputWithDN, $expectWithDN], - 'set group base' => ['ldapBaseGroups', $inputWithDN, $expectWithDN], + 'set user base' => ['ldapBaseUsers', $inputWithDN, $expectWithDN], + 'set group base' => ['ldapBaseGroups', $inputWithDN, $expectWithDN], - 'set search attributes users' => ['ldapAttributesForUserSearch', $inputNames, $expectedNames], + 'set search attributes users' => ['ldapAttributesForUserSearch', $inputNames, $expectedNames], 'set search attributes groups' => ['ldapAttributesForGroupSearch', $inputNames, $expectedNames], - 'set user filter objectclasses' => ['ldapUserFilterObjectclass', $inputNames, $expectedNames], - 'set user filter groups' => ['ldapUserFilterGroups', $inputNames, $expectedNames], + 'set user filter objectclasses' => ['ldapUserFilterObjectclass', $inputNames, $expectedNames], + 'set user filter groups' => ['ldapUserFilterGroups', $inputNames, $expectedNames], 'set group filter objectclasses' => ['ldapGroupFilterObjectclass', $inputNames, $expectedNames], - 'set group filter groups' => ['ldapGroupFilterGroups', $inputNames, $expectedNames], - 'set login filter attributes' => ['ldapLoginFilterAttributes', $inputNames, $expectedNames], + 'set group filter groups' => ['ldapGroupFilterGroups', $inputNames, $expectedNames], + 'set login filter attributes' => ['ldapLoginFilterAttributes', $inputNames, $expectedNames], 'set agent password' => ['ldapAgentPassword', $password, $password], 'set home folder, variant 1' => ['homeFolderNamingRule', $inputHomeFolder[0], $expectedHomeFolder[0]], 'set home folder, variant 2' => ['homeFolderNamingRule', $inputHomeFolder[1], $expectedHomeFolder[1]], - 'set home folder, empty' => ['homeFolderNamingRule', $inputHomeFolder[2], $expectedHomeFolder[2]], + 'set home folder, empty' => ['homeFolderNamingRule', $inputHomeFolder[2], $expectedHomeFolder[2]], // default behaviour, one case is enough, special needs must be tested // individually diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php index a4fcf030083..1269a5d7e43 100644 --- a/apps/user_ldap/tests/ConnectionTest.php +++ b/apps/user_ldap/tests/ConnectionTest.php @@ -50,7 +50,7 @@ class ConnectionTest extends \Test\TestCase { protected function setUp(): void { parent::setUp(); - $this->ldap = $this->createMock(ILDAPWrapper::class); + $this->ldap = $this->createMock(ILDAPWrapper::class); // we use a mock here to replace the cache mechanism, due to missing DI in LDAP backend. $this->connection = $this->getMockBuilder('OCA\User_LDAP\Connection') ->setMethods(['getFromCache', 'writeToCache']) @@ -66,7 +66,7 @@ class ConnectionTest extends \Test\TestCase { //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 - $lw = $this->createMock(ILDAPWrapper::class); + $lw = $this->createMock(ILDAPWrapper::class); $connection = new Connection($lw, '', null); $agent = [ diff --git a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php index e40f73a7596..b94016e352d 100644 --- a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php +++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php @@ -65,8 +65,8 @@ abstract class AbstractIntegrationTest { $this->server = [ 'host' => $host, 'port' => $port, - 'dn' => $bind, - 'pwd' => $pwd + 'dn' => $bind, + 'pwd' => $pwd ]; } diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php index 8c0bf6cde86..70ba46dba0c 100644 --- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php @@ -54,7 +54,7 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest { $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $userBackend = new User_LDAP($this->access, \OC::$server->getConfig(), \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query(UserPluginManager::class)); + $userBackend = new User_LDAP($this->access, \OC::$server->getConfig(), \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query(UserPluginManager::class)); \OC_User::useBackend($userBackend); } diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php index c48f51368bc..cefebe9f94e 100644 --- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserCleanUp.php @@ -47,7 +47,7 @@ class IntegrationTestUserCleanUp extends AbstractIntegrationTest { $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $userBackend = new User_LDAP($this->access, \OC::$server->getConfig(), \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query(UserPluginManager::class)); + $userBackend = new User_LDAP($this->access, \OC::$server->getConfig(), \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query(UserPluginManager::class)); \OC_User::useBackend($userBackend); } diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php index a5712b164d1..a6acdfb3ec6 100644 --- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserDisplayName.php @@ -45,7 +45,7 @@ class IntegrationTestUserDisplayName extends AbstractIntegrationTest { $this->mapping = new UserMapping(\OC::$server->getDatabaseConnection()); $this->mapping->clear(); $this->access->setUserMapper($this->mapping); - $userBackend = new User_LDAP($this->access, \OC::$server->getConfig(), \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query(UserPluginManager::class)); + $userBackend = new User_LDAP($this->access, \OC::$server->getConfig(), \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query(UserPluginManager::class)); \OC_User::useBackend($userBackend); } diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php index 73d246ac4e2..1e88694f7bf 100644 --- a/apps/user_ldap/tests/Jobs/CleanUpTest.php +++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php @@ -41,9 +41,9 @@ class CleanUpTest extends \Test\TestCase { $this->getMockBuilder('\OCA\User_LDAP\User\DeletedUsersIndex') ->disableOriginalConstructor() ->getMock(); - $mocks['ocConfig'] = $this->createMock(IConfig::class); - $mocks['db'] = $this->createMock(IDBConnection::class); - $mocks['helper'] = $this->createMock(Helper::class); + $mocks['ocConfig'] = $this->createMock(IConfig::class); + $mocks['db'] = $this->createMock(IDBConnection::class); + $mocks['helper'] = $this->createMock(Helper::class); return $mocks; } diff --git a/apps/user_ldap/tests/Jobs/SyncTest.php b/apps/user_ldap/tests/Jobs/SyncTest.php index 71868dcc617..a6a70493739 100644 --- a/apps/user_ldap/tests/Jobs/SyncTest.php +++ b/apps/user_ldap/tests/Jobs/SyncTest.php @@ -258,7 +258,7 @@ class SyncTest extends TestCase { $this->config->expects($this->exactly(2)) ->method('getAppValue') - ->willReturnOnConsecutiveCalls(time() - 60*40, time() - 60*20); + ->willReturnOnConsecutiveCalls(time() - 60 * 40, time() - 60 * 20); $this->sync->setArgument($this->arguments); $this->assertTrue($this->sync->qualifiesToRun($cycleData)); @@ -317,7 +317,7 @@ class SyncTest extends TestCase { } // for qualifiesToRun() if ($key === $runData['scheduledCycle']['prefix'] . '_lastChange') { - return time() - 60*40; + return time() - 60 * 40; } // for getMinPagingSize if ($key === $runData['scheduledCycle']['prefix'] . 'ldap_paging_size') { diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php index a8910c4a272..3e9d0515892 100644 --- a/apps/user_ldap/tests/LDAPProviderTest.php +++ b/apps/user_ldap/tests/LDAPProviderTest.php @@ -600,7 +600,7 @@ class LDAPProviderTest extends \Test\TestCase { ->willReturn(true); $userBackend->expects($this->at(3)) ->method('getConfiguration') - ->willReturn(['ldap_display_name'=>'displayName']); + ->willReturn(['ldap_display_name' => 'displayName']); $userBackend->expects($this->any()) ->method($this->anything()) ->willReturnSelf(); @@ -638,7 +638,7 @@ class LDAPProviderTest extends \Test\TestCase { ->willReturn(true); $userBackend->expects($this->at(3)) ->method('getConfiguration') - ->willReturn(['ldap_email_attr'=>'mail']); + ->willReturn(['ldap_email_attr' => 'mail']); $userBackend->expects($this->any()) ->method($this->anything()) ->willReturnSelf(); @@ -686,7 +686,7 @@ class LDAPProviderTest extends \Test\TestCase { ->willReturn(true); $groupBackend->expects($this->any()) ->method('getConfiguration') - ->willReturn(['ldap_group_member_assoc_attribute'=>'assoc_type']); + ->willReturn(['ldap_group_member_assoc_attribute' => 'assoc_type']); $groupBackend->expects($this->any()) ->method($this->anything()) ->willReturnSelf(); diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index 25a896aee04..3186a74ea89 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -72,7 +72,7 @@ class UserTest extends \Test\TestCase { /** @var string */ protected $uid = 'alice'; /** @var string */ - protected $dn = 'uid=alice,dc=foo,dc=bar'; + protected $dn = 'uid=alice,dc=foo,dc=bar'; /** @var User */ protected $user; diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 1c10e9955b3..ca9ff841ec0 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -1039,8 +1039,8 @@ class User_LDAPTest extends TestCase { public function testLoginName2UserNameSuccess() { $loginName = 'Alice'; - $username = 'alice'; - $dn = 'uid=alice,dc=what,dc=ever'; + $username = 'alice'; + $dn = 'uid=alice,dc=what,dc=ever'; $this->access->expects($this->once()) ->method('fetchUsersByLoginName') @@ -1118,7 +1118,7 @@ class User_LDAPTest extends TestCase { public function testLoginName2UserNameOfflineUser() { $loginName = 'Alice'; - $dn = 'uid=alice,dc=what,dc=ever'; + $dn = 'uid=alice,dc=what,dc=ever'; $offlineUser = $this->getMockBuilder(OfflineUser::class) ->disableOriginalConstructor() @@ -1311,7 +1311,7 @@ class User_LDAPTest extends TestCase { /** @dataProvider avatarDataProvider */ public function testCanChangeAvatar($imageData, $expected) { - $isValidImage = strpos((string)$imageData, 'valid') === 0; + $isValidImage = strpos((string)$imageData, 'valid') === 0; $user = $this->createMock(User::class); $user->expects($this->once()) diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php index da3239cb8f8..378d549bc27 100644 --- a/apps/user_ldap/tests/WizardTest.php +++ b/apps/user_ldap/tests/WizardTest.php @@ -65,10 +65,10 @@ class WizardTest extends TestCase { if (is_null($confMethods)) { $confMethods = get_class_methods('\OCA\User_LDAP\Configuration'); $connMethods = get_class_methods('\OCA\User_LDAP\Connection'); - $accMethods = get_class_methods('\OCA\User_LDAP\Access'); + $accMethods = get_class_methods('\OCA\User_LDAP\Access'); } /** @var ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject $lw */ - $lw = $this->createMock(ILDAPWrapper::class); + $lw = $this->createMock(ILDAPWrapper::class); /** @var Configuration|\PHPUnit\Framework\MockObject\MockObject $conf */ $conf = $this->getMockBuilder(Configuration::class) |