diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/user_ldap/tests/Mapping/AbstractMappingTest.php | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip |
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/user_ldap/tests/Mapping/AbstractMappingTest.php')
-rw-r--r-- | apps/user_ldap/tests/Mapping/AbstractMappingTest.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php index a298c8b4bce..079c2e21b10 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTest.php @@ -77,7 +77,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { * @param array $data */ protected function mapEntries($mapper, $data) { - foreach($data as $entry) { + foreach ($data as $entry) { $done = $mapper->map($entry['dn'], $entry['name'], $entry['uuid']); $this->assertTrue($done); } @@ -111,9 +111,9 @@ abstract class AbstractMappingTest extends \Test\TestCase { // test that mapping will not happen when it shall not $tooLongDN = 'uid=joann,ou=Secret Small Specialized Department,ou=Some Tremendously Important Department,ou=Another Very Important Department,ou=Pretty Meaningful Derpartment,ou=Quite Broad And General Department,ou=The Topmost Department,dc=hugelysuccessfulcompany,dc=com'; $paramKeys = ['', 'dn', 'name', 'uuid', $tooLongDN]; - foreach($paramKeys as $key) { + foreach ($paramKeys as $key) { $failEntry = $data[0]; - if(!empty($key)) { + if (!empty($key)) { $failEntry[$key] = 'do-not-get-mapped'; } $isMapped = $mapper->map($failEntry['dn'], $failEntry['name'], $failEntry['uuid']); @@ -128,7 +128,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { public function testUnmap() { list($mapper, $data) = $this->initTest(); - foreach($data as $entry) { + foreach ($data as $entry) { $result = $mapper->unmap($entry['name']); $this->assertTrue($result); } @@ -144,21 +144,21 @@ abstract class AbstractMappingTest extends \Test\TestCase { public function testGetMethods() { list($mapper, $data) = $this->initTest(); - foreach($data as $entry) { + foreach ($data as $entry) { $fdn = $mapper->getDNByName($entry['name']); $this->assertSame($fdn, $entry['dn']); } $fdn = $mapper->getDNByName('nosuchname'); $this->assertFalse($fdn); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByDN($entry['dn']); $this->assertSame($name, $entry['name']); } $name = $mapper->getNameByDN('nosuchdn'); $this->assertFalse($name); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByUUID($entry['uuid']); $this->assertSame($name, $entry['name']); } @@ -229,7 +229,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { $done = $mapper->clear(); $this->assertTrue($done); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByUUID($entry['uuid']); $this->assertFalse($name); } @@ -252,7 +252,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { $done = $mapper->clearCb($callback, $callback); $this->assertTrue($done); $this->assertSame(count($data) * 2, $callbackCalls); - foreach($data as $entry) { + foreach ($data as $entry) { $name = $mapper->getNameByUUID($entry['uuid']); $this->assertFalse($name); } |