Completed
Push — master ( 81d0c7...618175 )
by
unknown
26:17
created
tests/lib/TestCase.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 			// restore database connection
45 45
 			if (!$this->IsDatabaseAccessAllowed()) {
46
-				\OC::$server->registerService(IDBConnection::class, function () {
46
+				\OC::$server->registerService(IDBConnection::class, function() {
47 47
 					return self::$realDatabase;
48 48
 				});
49 49
 			}
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 			// restore database connection
60 60
 			if (!$this->IsDatabaseAccessAllowed()) {
61
-				\OC::$server->registerService(IDBConnection::class, function () {
61
+				\OC::$server->registerService(IDBConnection::class, function() {
62 62
 					return self::$realDatabase;
63 63
 				});
64 64
 			}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$container = \OC::$server->getAppContainerForService($name);
102 102
 		$container = $container ?? \OC::$server;
103 103
 
104
-		$container->registerService($name, function () use ($newService) {
104
+		$container->registerService($name, function() use ($newService) {
105 105
 			return $newService;
106 106
 		});
107 107
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 			$container = $container ?? \OC::$server;
121 121
 
122 122
 			if ($oldService !== false) {
123
-				$container->registerService($name, function () use ($oldService) {
123
+				$container->registerService($name, function() use ($oldService) {
124 124
 					return $oldService;
125 125
 				});
126 126
 			} else {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			$traits = array_merge(class_uses($trait), $traits);
156 156
 		}
157 157
 		$traits = array_unique($traits);
158
-		return array_filter($traits, function ($trait) {
158
+		return array_filter($traits, function($trait) {
159 159
 			return substr($trait, 0, 5) === 'Test\\';
160 160
 		});
161 161
 	}
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
 			if (is_null(self::$realDatabase)) {
174 174
 				self::$realDatabase = Server::get(IDBConnection::class);
175 175
 			}
176
-			\OC::$server->registerService(IDBConnection::class, function (): void {
176
+			\OC::$server->registerService(IDBConnection::class, function(): void {
177 177
 				$this->fail('Your test case is not allowed to access the database.');
178 178
 			});
179 179
 		}
180 180
 
181 181
 		$traits = $this->getTestTraits();
182 182
 		foreach ($traits as $trait) {
183
-			$methodName = 'setUp' . basename(str_replace('\\', '/', $trait));
183
+			$methodName = 'setUp'.basename(str_replace('\\', '/', $trait));
184 184
 			if (method_exists($this, $methodName)) {
185 185
 				call_user_func([$this, $methodName]);
186 186
 			}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
 		// restore database connection
194 194
 		if (!$this->IsDatabaseAccessAllowed()) {
195
-			\OC::$server->registerService(IDBConnection::class, function () {
195
+			\OC::$server->registerService(IDBConnection::class, function() {
196 196
 				return self::$realDatabase;
197 197
 			});
198 198
 		}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		// tearDown the traits
220 220
 		$traits = $this->getTestTraits();
221 221
 		foreach ($traits as $trait) {
222
-			$methodName = 'tearDown' . basename(str_replace('\\', '/', $trait));
222
+			$methodName = 'tearDown'.basename(str_replace('\\', '/', $trait));
223 223
 			if (method_exists($this, $methodName)) {
224 224
 				call_user_func([$this, $methodName]);
225 225
 			}
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
 	 * @return string
282 282
 	 */
283 283
 	protected static function getUniqueID($prefix = '', $length = 13) {
284
-		return $prefix . Server::get(ISecureRandom::class)->generate(
284
+		return $prefix.Server::get(ISecureRandom::class)->generate(
285 285
 			$length,
286 286
 			// Do not use dots and slashes as we use the value for file names
287
-			ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER
287
+			ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER
288 288
 		);
289 289
 	}
290 290
 
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
 		if (!self::$wasDatabaseAllowed && self::$realDatabase !== null) {
317 317
 			// in case an error is thrown in a test, PHPUnit jumps straight to tearDownAfterClass,
318 318
 			// so we need the database again
319
-			\OC::$server->registerService(IDBConnection::class, function () {
319
+			\OC::$server->registerService(IDBConnection::class, function() {
320 320
 				return self::$realDatabase;
321 321
 			});
322 322
 		}
323
-		$dataDir = Server::get(IConfig::class)->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data-autotest');
323
+		$dataDir = Server::get(IConfig::class)->getSystemValueString('datadirectory', \OC::$SERVERROOT.'/data-autotest');
324 324
 		if (self::$wasDatabaseAllowed && Server::get(IDBConnection::class)) {
325 325
 			$db = Server::get(IDBConnection::class);
326 326
 			if ($db->inTransaction()) {
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		if ($dh = opendir($dataDir)) {
407 407
 			while (($file = readdir($dh)) !== false) {
408 408
 				if (!isset($knownEntries[$file])) {
409
-					self::tearDownAfterClassCleanStrayDataUnlinkDir($dataDir . '/' . $file);
409
+					self::tearDownAfterClassCleanStrayDataUnlinkDir($dataDir.'/'.$file);
410 410
 				}
411 411
 			}
412 412
 			closedir($dh);
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 				if (Filesystem::isIgnoredDir($file)) {
425 425
 					continue;
426 426
 				}
427
-				$path = $dir . '/' . $file;
427
+				$path = $dir.'/'.$file;
428 428
 				if (is_dir($path)) {
429 429
 					self::tearDownAfterClassCleanStrayDataUnlinkDir($path);
430 430
 				} else {
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 		$doc = $r->getDocComment();
549 549
 
550 550
 		if (class_exists(Group::class)) {
551
-			$attributes = array_map(function (\ReflectionAttribute $attribute) {
551
+			$attributes = array_map(function(\ReflectionAttribute $attribute) {
552 552
 				/** @var Group $group */
553 553
 				$group = $attribute->newInstance();
554 554
 				return $group->name();
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 		$l10n
592 592
 			->expects($this->any())
593 593
 			->method('t')
594
-			->willReturnCallback(function ($text, $parameters = []) {
594
+			->willReturnCallback(function($text, $parameters = []) {
595 595
 				return vsprintf($text, $parameters);
596 596
 			});
597 597
 
Please login to merge, or discard this patch.