summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-09 13:53:40 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-09 13:54:22 +0200
commitafbd9c4e6ed834e713039f2cff88ba3eec03dadb (patch)
tree7d8721cf8fc0329d6b750db63798de67a162b090 /apps/user_ldap/tests
parent19e97e86c69ab128191439d6a17dacb5a630cf98 (diff)
downloadnextcloud-server-afbd9c4e6ed834e713039f2cff88ba3eec03dadb.tar.gz
nextcloud-server-afbd9c4e6ed834e713039f2cff88ba3eec03dadb.zip
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/AccessTest.php6
-rw-r--r--apps/user_ldap/tests/Group_LDAPTest.php24
-rw-r--r--apps/user_ldap/tests/HelperTest.php4
-rw-r--r--apps/user_ldap/tests/Integration/AbstractIntegrationTest.php4
-rw-r--r--apps/user_ldap/tests/Jobs/SyncTest.php4
-rw-r--r--apps/user_ldap/tests/LDAPTest.php4
-rw-r--r--apps/user_ldap/tests/User/UserTest.php18
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php74
-rw-r--r--apps/user_ldap/tests/WizardTest.php24
9 files changed, 81 insertions, 81 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 35d38b24920..a805f387086 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -538,7 +538,7 @@ class AccessTest extends TestCase {
->willReturn($fakeConnection);
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($key) use ($base) {
+ ->willReturnCallback(function ($key) use ($base) {
if(stripos($key, 'base') !== false) {
return $base;
}
@@ -616,7 +616,7 @@ class AccessTest extends TestCase {
];
$expected = $fakeLdapEntries;
unset($expected['count']);
- array_walk($expected, function(&$v) {
+ array_walk($expected, function (&$v) {
$v['dn'] = [$v['dn']]; // dn is translated into an array internally for consistency
});
@@ -628,7 +628,7 @@ class AccessTest extends TestCase {
$this->userMapper->expects($this->exactly($fakeLdapEntries['count']))
->method('getNameByDN')
- ->willReturnCallback(function($fdn) {
+ ->willReturnCallback(function ($fdn) {
$parts = ldap_explode_dn($fdn, false);
return $parts[0];
});
diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php
index fb5840f0ddb..a81255c10a9 100644
--- a/apps/user_ldap/tests/Group_LDAPTest.php
+++ b/apps/user_ldap/tests/Group_LDAPTest.php
@@ -88,7 +88,7 @@ class Group_LDAPTest extends TestCase {
$access->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapDynamicGroupMemberURL') {
return '';
}
@@ -109,7 +109,7 @@ class Group_LDAPTest extends TestCase {
$access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn) use ($groupDN) {
+ ->willReturnCallback(function ($dn) use ($groupDN) {
if($dn === $groupDN) {
return [
'uid=u11,ou=users,dc=foo,dc=bar',
@@ -148,7 +148,7 @@ class Group_LDAPTest extends TestCase {
$access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
//the search operation will call readAttribute, thus we need
//to anaylze the "dn". All other times we just need to return
//something that is neither null or false, but once an array
@@ -162,7 +162,7 @@ class Group_LDAPTest extends TestCase {
$access->expects($this->any())
->method('dn2username')
- ->willReturnCallback(function() {
+ ->willReturnCallback(function () {
return 'foobar' . \OC::$server->getSecureRandom()->generate(7);
});
@@ -520,7 +520,7 @@ class Group_LDAPTest extends TestCase {
->willReturn(null);
$access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($attr === 'primaryGroupToken') {
return [1337];
} else if($attr === 'gidNumber') {
@@ -557,7 +557,7 @@ class Group_LDAPTest extends TestCase {
->willReturn(null);
$access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($attr === 'primaryGroupToken') {
return [1337];
}
@@ -593,7 +593,7 @@ class Group_LDAPTest extends TestCase {
$access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($attr === 'primaryGroupToken') {
return [1337];
}
@@ -654,7 +654,7 @@ class Group_LDAPTest extends TestCase {
$access->connection = $this->createMock(Connection::class);
$access->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'useMemberOfToDetectMembership') {
return 0;
} else if($name === 'ldapDynamicGroupMemberURL') {
@@ -692,7 +692,7 @@ class Group_LDAPTest extends TestCase {
$access->connection = $this->createMock(Connection::class);
$access->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
switch($name) {
case 'useMemberOfToDetectMembership':
return 0;
@@ -1030,7 +1030,7 @@ class Group_LDAPTest extends TestCase {
$access = $this->getAccessMock();
$access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($group) use ($groupDN, $expectedMembers, $groupsInfo) {
+ ->willReturnCallback(function ($group) use ($groupDN, $expectedMembers, $groupsInfo) {
if(isset($groupsInfo[$group])) {
return $groupsInfo[$group];
}
@@ -1041,7 +1041,7 @@ class Group_LDAPTest extends TestCase {
if(count($groupsInfo) > 1) {
$access->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapNestedGroups') {
return 1;
}
@@ -1079,7 +1079,7 @@ class Group_LDAPTest extends TestCase {
$access->connection = $this->createMock(Connection::class);
$access->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapGroupMemberAssocAttr') {
return 'member';
} else if($name === 'ldapGroupFilter') {
diff --git a/apps/user_ldap/tests/HelperTest.php b/apps/user_ldap/tests/HelperTest.php
index a803e5d284a..5aace2c5c91 100644
--- a/apps/user_ldap/tests/HelperTest.php
+++ b/apps/user_ldap/tests/HelperTest.php
@@ -67,7 +67,7 @@ class HelperTest extends \Test\TestCase {
]);
$this->config->method('getAppValue')
- ->willReturnCallback(function($app, $key, $default) {
+ ->willReturnCallback(function ($app, $key, $default) {
if ($app !== 'user_ldap') {
$this->fail('wrong app');
}
@@ -93,7 +93,7 @@ class HelperTest extends \Test\TestCase {
]);
$this->config->method('getAppValue')
- ->willReturnCallback(function($app, $key, $default) {
+ ->willReturnCallback(function ($app, $key, $default) {
if ($app !== 'user_ldap') {
$this->fail('wrong app');
}
diff --git a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
index a3c4dd364fe..77aeddf94f5 100644
--- a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
+++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
@@ -71,10 +71,10 @@ abstract class AbstractIntegrationTest {
* the LDAP backend.
*/
public function init() {
- \OC::$server->registerService('LDAPUserPluginManager', function() {
+ \OC::$server->registerService('LDAPUserPluginManager', function () {
return new \OCA\User_LDAP\UserPluginManager();
});
- \OC::$server->registerService('LDAPGroupPluginManager', function() {
+ \OC::$server->registerService('LDAPGroupPluginManager', function () {
return new \OCA\User_LDAP\GroupPluginManager();
});
diff --git a/apps/user_ldap/tests/Jobs/SyncTest.php b/apps/user_ldap/tests/Jobs/SyncTest.php
index 8cab95fc801..1cdbefb289c 100644
--- a/apps/user_ldap/tests/Jobs/SyncTest.php
+++ b/apps/user_ldap/tests/Jobs/SyncTest.php
@@ -128,7 +128,7 @@ class SyncTest extends TestCase {
$this->config->expects($this->once())
->method('setAppValue')
->with('user_ldap', 'background_sync_interval', $this->anything())
- ->willReturnCallback(function($a, $k, $interval) {
+ ->willReturnCallback(function ($a, $k, $interval) {
$this->assertTrue($interval >= SYNC::MIN_INTERVAL);
$this->assertTrue($interval <= SYNC::MAX_INTERVAL);
return true;
@@ -294,7 +294,7 @@ class SyncTest extends TestCase {
public function testRun($runData) {
$this->config->expects($this->any())
->method('getAppValue')
- ->willReturnCallback(function($app, $key, $default) use ($runData) {
+ ->willReturnCallback(function ($app, $key, $default) use ($runData) {
if($app === 'core' && $key === 'backgroundjobs_mode') {
return 'cron';
}
diff --git a/apps/user_ldap/tests/LDAPTest.php b/apps/user_ldap/tests/LDAPTest.php
index 56ee04906b7..8dd7122b4e1 100644
--- a/apps/user_ldap/tests/LDAPTest.php
+++ b/apps/user_ldap/tests/LDAPTest.php
@@ -60,7 +60,7 @@ class LDAPTest extends TestCase {
public function testSearchWithErrorHandler(string $errorMessage, bool $passThrough) {
$wasErrorHandlerCalled = false;
- $errorHandler = function($number, $message, $file, $line) use (&$wasErrorHandlerCalled) {
+ $errorHandler = function ($number, $message, $file, $line) use (&$wasErrorHandlerCalled) {
$wasErrorHandlerCalled = true;
};
@@ -70,7 +70,7 @@ class LDAPTest extends TestCase {
->expects($this->once())
->method('invokeLDAPMethod')
->with('search', $this->anything(), $this->anything(), $this->anything(), $this->anything(), $this->anything())
- ->willReturnCallback(function() use($errorMessage) {
+ ->willReturnCallback(function () use ($errorMessage) {
trigger_error($errorMessage);
});
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php
index 4e8dacaeda1..7453b31e338 100644
--- a/apps/user_ldap/tests/User/UserTest.php
+++ b/apps/user_ldap/tests/User/UserTest.php
@@ -606,7 +606,7 @@ class UserTest extends \Test\TestCase {
public function XtestUpdateAvatarThumbnailPhotoProvided() {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($dn === $this->dn
&& $attr === 'jpegphoto')
{
@@ -671,7 +671,7 @@ class UserTest extends \Test\TestCase {
public function testUpdateAvatarCorruptPhotoProvided() {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($dn === $this->dn
&& $attr === 'jpegphoto')
{
@@ -724,7 +724,7 @@ class UserTest extends \Test\TestCase {
public function XtestUpdateAvatarUnsupportedThumbnailPhotoProvided() {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($dn === $this->dn
&& $attr === 'jpegphoto')
{
@@ -789,7 +789,7 @@ class UserTest extends \Test\TestCase {
public function testUpdateAvatarNotProvided() {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
if($dn === $this->dn
&& $attr === 'jpegPhoto')
{
@@ -1038,7 +1038,7 @@ class UserTest extends \Test\TestCase {
]);
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'homeFolderNamingRule') {
return 'attr:homeDirectory';
}
@@ -1193,7 +1193,7 @@ class UserTest extends \Test\TestCase {
public function testHandlePasswordExpiryWarningDefaultPolicy() {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapDefaultPPolicyDN') {
return 'cn=default,ou=policies,dc=foo,dc=bar';
}
@@ -1205,7 +1205,7 @@ class UserTest extends \Test\TestCase {
$this->access->expects($this->any())
->method('search')
- ->willReturnCallback(function($filter, $base) {
+ ->willReturnCallback(function ($filter, $base) {
if($base === [$this->dn]) {
return [
[
@@ -1256,7 +1256,7 @@ class UserTest extends \Test\TestCase {
public function testHandlePasswordExpiryWarningCustomPolicy() {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapDefaultPPolicyDN') {
return 'cn=default,ou=policies,dc=foo,dc=bar';
}
@@ -1268,7 +1268,7 @@ class UserTest extends \Test\TestCase {
$this->access->expects($this->any())
->method('search')
- ->willReturnCallback(function($filter, $base) {
+ ->willReturnCallback(function ($filter, $base) {
if($base === [$this->dn]) {
return [
[
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 3f0259692ac..8dc699f371b 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -108,7 +108,7 @@ class User_LDAPTest extends TestCase {
private function prepareMockForUserExists() {
$this->access->expects($this->any())
->method('username2dn')
- ->willReturnCallback(function($uid) {
+ ->willReturnCallback(function ($uid) {
switch ($uid) {
case 'gunslinger':
return 'dnOfRoland,dc=test';
@@ -139,7 +139,7 @@ class User_LDAPTest extends TestCase {
private function prepareAccessForCheckPassword($noDisplayName = false) {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapLoginFilter') {
return '%uid';
}
@@ -148,7 +148,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('fetchListOfUsers')
- ->willReturnCallback(function($filter) {
+ ->willReturnCallback(function ($filter) {
if($filter === 'roland') {
return [['dn' => ['dnOfRoland,dc=test']]];
}
@@ -156,7 +156,7 @@ class User_LDAPTest extends TestCase {
});
$this->access->expects($this->any())
->method('fetchUsersByLoginName')
- ->willReturnCallback(function($uid) {
+ ->willReturnCallback(function ($uid) {
if($uid === 'roland') {
return [['dn' => ['dnOfRoland,dc=test']]];
}
@@ -177,7 +177,7 @@ class User_LDAPTest extends TestCase {
->willReturn(true);
$this->access->expects($this->any())
->method('areCredentialsValid')
- ->willReturnCallback(function($dn, $pwd) {
+ ->willReturnCallback(function ($dn, $pwd) {
if($pwd === 'dt19') {
return true;
}
@@ -363,22 +363,22 @@ class User_LDAPTest extends TestCase {
private function prepareAccessForGetUsers() {
$this->access->expects($this->once())
->method('escapeFilterPart')
- ->willReturnCallback(function($search) {
+ ->willReturnCallback(function ($search) {
return $search;
});
$this->access->expects($this->any())
->method('getFilterPartForUserSearch')
- ->willReturnCallback(function($search) {
+ ->willReturnCallback(function ($search) {
return $search;
});
$this->access->expects($this->any())
->method('combineFilterWithAnd')
- ->willReturnCallback(function($param) {
+ ->willReturnCallback(function ($param) {
return $param[2];
});
$this->access->expects($this->any())
->method('fetchListOfUsers')
- ->willReturnCallback(function($search, $a, $l, $o) {
+ ->willReturnCallback(function ($search, $a, $l, $o) {
$users = ['gunslinger', 'newyorker', 'ladyofshadows'];
if(empty($search)) {
$result = $users;
@@ -444,7 +444,7 @@ class User_LDAPTest extends TestCase {
private function getUsers($search = '', $limit = null, $offset = null) {
$users = \OC::$server->getUserManager()->search($search, $limit, $offset);
- $uids = array_map(function(IUser $user) {
+ $uids = array_map(function (IUser $user) {
return $user->getUID();
}, $users);
return $uids;
@@ -544,7 +544,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn) {
+ ->willReturnCallback(function ($dn) {
if($dn === 'dnOfRoland,dc=test') {
return [];
}
@@ -569,7 +569,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn) {
+ ->willReturnCallback(function ($dn) {
if($dn === 'dnOfRoland,dc=test') {
return [];
}
@@ -601,7 +601,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'homeFolderNamingRule') {
return 'attr:testAttribute';
}
@@ -610,7 +610,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
switch ($dn) {
case 'dnOfRoland,dc=test':
if($attr === 'testAttribute') {
@@ -653,7 +653,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'homeFolderNamingRule') {
return 'attr:testAttribute';
}
@@ -662,7 +662,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
switch ($dn) {
case 'dnOfLadyOfShadows,dc=test':
if($attr === 'testAttribute') {
@@ -704,7 +704,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'homeFolderNamingRule') {
return 'attr:testAttribute';
}
@@ -712,7 +712,7 @@ class User_LDAPTest extends TestCase {
});
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
switch ($dn) {
default:
return false;
@@ -720,7 +720,7 @@ class User_LDAPTest extends TestCase {
});
$this->access->connection->expects($this->any())
->method('getFromCache')
- ->willReturnCallback(function($key) {
+ ->willReturnCallback(function ($key) {
if($key === 'userExistsnewyorker') {
return true;
}
@@ -752,7 +752,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'homeFolderNamingRule') {
return 'attr:testAttribute';
}
@@ -798,7 +798,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('getFromCache')
- ->willReturnCallback(function($uid) {
+ ->willReturnCallback(function ($uid) {
return true;
});
@@ -809,7 +809,7 @@ class User_LDAPTest extends TestCase {
private function prepareAccessForGetDisplayName() {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapUserDisplayName') {
return 'displayname';
}
@@ -818,7 +818,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('readAttribute')
- ->willReturnCallback(function($dn, $attr) {
+ ->willReturnCallback(function ($dn, $attr) {
switch ($dn) {
case 'dnOfRoland,dc=test':
if($attr === 'displayname') {
@@ -842,7 +842,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('getConnectionResource')
- ->willReturnCallback(function() {
+ ->willReturnCallback(function () {
return true;
});
@@ -864,11 +864,11 @@ class User_LDAPTest extends TestCase {
$mapper = $this->createMock(UserMapping::class);
$mapper->expects($this->any())
->method('getUUIDByDN')
- ->willReturnCallback(function($dn) { return $dn; });
+ ->willReturnCallback(function ($dn) { return $dn; });
$this->userManager->expects($this->any())
->method('get')
- ->willReturnCallback(function($uid) use ($user1, $user2) {
+ ->willReturnCallback(function ($uid) use ($user1, $user2) {
if($uid === 'gunslinger') {
return $user1;
} else if($uid === 'newyorker') {
@@ -881,7 +881,7 @@ class User_LDAPTest extends TestCase {
->willReturn($mapper);
$this->access->expects($this->any())
->method('getUserDnByUuid')
- ->willReturnCallback(function($uuid) { return $uuid . '1'; });
+ ->willReturnCallback(function ($uuid) { return $uuid . '1'; });
//with displayName
$result = $backend->getDisplayName('gunslinger');
@@ -895,7 +895,7 @@ class User_LDAPTest extends TestCase {
public function testGetDisplayNamePublicAPI() {
$this->access->expects($this->any())
->method('username2dn')
- ->willReturnCallback(function($uid) {
+ ->willReturnCallback(function ($uid) {
switch ($uid) {
case 'gunslinger':
return 'dnOfRoland,dc=test';
@@ -919,7 +919,7 @@ class User_LDAPTest extends TestCase {
$this->connection->expects($this->any())
->method('getConnectionResource')
- ->willReturnCallback(function() {
+ ->willReturnCallback(function () {
return true;
});
@@ -943,11 +943,11 @@ class User_LDAPTest extends TestCase {
$mapper = $this->createMock(UserMapping::class);
$mapper->expects($this->any())
->method('getUUIDByDN')
- ->willReturnCallback(function($dn) { return $dn; });
+ ->willReturnCallback(function ($dn) { return $dn; });
$this->userManager->expects($this->any())
->method('get')
- ->willReturnCallback(function($uid) use ($user1, $user2) {
+ ->willReturnCallback(function ($uid) use ($user1, $user2) {
if($uid === 'gunslinger') {
return $user1;
} else if($uid === 'newyorker') {
@@ -960,7 +960,7 @@ class User_LDAPTest extends TestCase {
->willReturn($mapper);
$this->access->expects($this->any())
->method('getUserDnByUuid')
- ->willReturnCallback(function($uuid) { return $uuid . '1'; });
+ ->willReturnCallback(function ($uuid) { return $uuid . '1'; });
//with displayName
$result = \OC::$server->getUserManager()->get('gunslinger')->getDisplayName();
@@ -1135,7 +1135,7 @@ class User_LDAPTest extends TestCase {
private function prepareAccessForSetPassword($enablePasswordChange = true) {
$this->connection->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) use (&$enablePasswordChange) {
+ ->willReturnCallback(function ($name) use (&$enablePasswordChange) {
if($name === 'ldapLoginFilter') {
return '%uid';
}
@@ -1146,7 +1146,7 @@ class User_LDAPTest extends TestCase {
});
$this->connection->expects($this->any())
->method('getFromCache')
- ->willReturnCallback(function($uid) {
+ ->willReturnCallback(function ($uid) {
if($uid === 'userExists'.'roland') {
return true;
}
@@ -1155,7 +1155,7 @@ class User_LDAPTest extends TestCase {
$this->access->expects($this->any())
->method('fetchListOfUsers')
- ->willReturnCallback(function($filter) {
+ ->willReturnCallback(function ($filter) {
if($filter === 'roland') {
return [['dn' => ['dnOfRoland,dc=test']]];
}
@@ -1163,7 +1163,7 @@ class User_LDAPTest extends TestCase {
});
$this->access->expects($this->any())
->method('fetchUsersByLoginName')
- ->willReturnCallback(function($uid) {
+ ->willReturnCallback(function ($uid) {
if($uid === 'roland') {
return [['dn' => ['dnOfRoland,dc=test']]];
}
@@ -1179,7 +1179,7 @@ class User_LDAPTest extends TestCase {
->willReturn(true);
$this->access->expects($this->any())
->method('setPassword')
- ->willReturnCallback(function($uid, $password) {
+ ->willReturnCallback(function ($uid, $password) {
if(strlen($password) <= 5) {
throw new HintException('Password fails quality checking policy', '', 19);
}
diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php
index d3a988a06b7..0a94eb2a1f4 100644
--- a/apps/user_ldap/tests/WizardTest.php
+++ b/apps/user_ldap/tests/WizardTest.php
@@ -103,7 +103,7 @@ class WizardTest extends TestCase {
$configuration->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapBase') {
return ['base'];
}
@@ -147,7 +147,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->exactly(10))
->method('getDN')
//dummy value, usually invalid
- ->willReturnCallback(function($a, $b) {
+ ->willReturnCallback(function ($a, $b) {
global $uidnumber;
return $uidnumber++;
});
@@ -163,7 +163,7 @@ class WizardTest extends TestCase {
$configuration->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapBase') {
return ['base'];
}
@@ -174,7 +174,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->any())
->method('isResource')
- ->willReturnCallback(function($r) {
+ ->willReturnCallback(function ($r) {
if($r === true) {
return true;
}
@@ -200,7 +200,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->exactly(2))
->method('firstEntry')
//dummy value, usually invalid
- ->willReturnCallback(function($r) {
+ ->willReturnCallback(function ($r) {
global $uidnumber;
return $uidnumber;
});
@@ -208,7 +208,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->exactly(46))
->method('nextEntry')
//dummy value, usually invalid
- ->willReturnCallback(function($r) {
+ ->willReturnCallback(function ($r) {
global $uidnumber;
return $uidnumber;
});
@@ -223,7 +223,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->exactly(46))
->method('getDN')
//dummy value, usually invalid
- ->willReturnCallback(function($a, $b) {
+ ->willReturnCallback(function ($a, $b) {
global $uidnumber;
return $uidnumber++;
});
@@ -379,7 +379,7 @@ class WizardTest extends TestCase {
$configuration->expects($this->any())
->method('__get')
- ->willReturnCallback(function($name) {
+ ->willReturnCallback(function ($name) {
if($name === 'ldapBase') {
return ['base'];
}
@@ -390,7 +390,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->any())
->method('isResource')
- ->willReturnCallback(function($res) {
+ ->willReturnCallback(function ($res) {
return (bool)$res;
});
@@ -416,7 +416,7 @@ class WizardTest extends TestCase {
$ldap->expects($this->any())
->method('nextEntry')
//dummy value, usually invalid
- ->willReturnCallback(function($a, $prev){
+ ->willReturnCallback(function ($a, $prev) {
$current = $prev + 1;
if($current === 7) {
return false;
@@ -432,14 +432,14 @@ class WizardTest extends TestCase {
$ldap->expects($this->any())
->method('getAttributes')
//dummy value, usually invalid
- ->willReturnCallback(function($a, $entry) {
+ ->willReturnCallback(function ($a, $entry) {
return ['cn' => [$entry], 'count' => 1];
});
$ldap->expects($this->any())
->method('getDN')
//dummy value, usually invalid
- ->willReturnCallback(function($a, $b) {
+ ->willReturnCallback(function ($a, $b) {
return $b;
});