Completed
Push — master ( c06d85...d20e4d )
by Joas
20:12 queued 13s
created
tests/lib/L10N/FactoryTest.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		$factory->expects(self::once())
288 288
 			->method('findL10nDir')
289 289
 			->with($app)
290
-			->willReturn(\OC::$SERVERROOT . '/tests/data/l10n/');
290
+			->willReturn(\OC::$SERVERROOT.'/tests/data/l10n/');
291 291
 
292 292
 		self::assertEqualsCanonicalizing(['cs', 'de', 'en', 'ru'], $factory->findAvailableLanguages($app));
293 293
 	}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 		$factory->expects(self::once())
314 314
 			->method('findL10nDir')
315 315
 			->with($app)
316
-			->willReturn($this->serverRoot . '/apps/files/l10n/');
316
+			->willReturn($this->serverRoot.'/apps/files/l10n/');
317 317
 		$this->config
318 318
 			->expects(self::once())
319 319
 			->method('getSystemValueString')
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 			->willReturn($availableLanguages);
380 380
 
381 381
 		$factory->expects(self::any())
382
-			->method('respectDefaultLanguage')->willReturnCallback(function ($app, $lang) {
382
+			->method('respectDefaultLanguage')->willReturnCallback(function($app, $lang) {
383 383
 				return $lang;
384 384
 			});
385 385
 
@@ -398,13 +398,13 @@  discard block
 block discarded – undo
398 398
 
399 399
 	public static function dataGetL10nFilesForApp(): array {
400 400
 		return [
401
-			['', 'de', [\OC::$SERVERROOT . '/core/l10n/de.json']],
402
-			['core', 'ru', [\OC::$SERVERROOT . '/core/l10n/ru.json']],
403
-			['lib', 'ru', [\OC::$SERVERROOT . '/lib/l10n/ru.json']],
404
-			['settings', 'de', [\OC::$SERVERROOT . '/apps/settings/l10n/de.json']],
405
-			['files', 'de', [\OC::$SERVERROOT . '/apps/files/l10n/de.json']],
401
+			['', 'de', [\OC::$SERVERROOT.'/core/l10n/de.json']],
402
+			['core', 'ru', [\OC::$SERVERROOT.'/core/l10n/ru.json']],
403
+			['lib', 'ru', [\OC::$SERVERROOT.'/lib/l10n/ru.json']],
404
+			['settings', 'de', [\OC::$SERVERROOT.'/apps/settings/l10n/de.json']],
405
+			['files', 'de', [\OC::$SERVERROOT.'/apps/files/l10n/de.json']],
406 406
 			['files', '_lang_never_exists_', []],
407
-			['_app_never_exists_', 'de', [\OC::$SERVERROOT . '/core/l10n/de.json']],
407
+			['_app_never_exists_', 'de', [\OC::$SERVERROOT.'/core/l10n/de.json']],
408 408
 		];
409 409
 	}
410 410
 
@@ -416,11 +416,11 @@  discard block
 block discarded – undo
416 416
 	 */
417 417
 	public function testGetL10nFilesForApp($app, $lang, $expected): void {
418 418
 		$factory = $this->getFactory();
419
-		if (in_array($app, ['settings','files'])) {
419
+		if (in_array($app, ['settings', 'files'])) {
420 420
 			$this->appManager
421 421
 				->method('getAppPath')
422 422
 				->with($app)
423
-				->willReturn(\OC::$SERVERROOT . '/apps/' . $app);
423
+				->willReturn(\OC::$SERVERROOT.'/apps/'.$app);
424 424
 		} else {
425 425
 			$this->appManager
426 426
 				->method('getAppPath')
@@ -432,12 +432,12 @@  discard block
 block discarded – undo
432 432
 
433 433
 	public static function dataFindL10NDir(): array {
434 434
 		return [
435
-			['', \OC::$SERVERROOT . '/core/l10n/'],
436
-			['core', \OC::$SERVERROOT . '/core/l10n/'],
437
-			['lib', \OC::$SERVERROOT . '/lib/l10n/'],
438
-			['settings', \OC::$SERVERROOT . '/apps/settings/l10n/'],
439
-			['files', \OC::$SERVERROOT . '/apps/files/l10n/'],
440
-			['_app_never_exists_', \OC::$SERVERROOT . '/core/l10n/'],
435
+			['', \OC::$SERVERROOT.'/core/l10n/'],
436
+			['core', \OC::$SERVERROOT.'/core/l10n/'],
437
+			['lib', \OC::$SERVERROOT.'/lib/l10n/'],
438
+			['settings', \OC::$SERVERROOT.'/apps/settings/l10n/'],
439
+			['files', \OC::$SERVERROOT.'/apps/files/l10n/'],
440
+			['_app_never_exists_', \OC::$SERVERROOT.'/core/l10n/'],
441 441
 		];
442 442
 	}
443 443
 
@@ -449,11 +449,11 @@  discard block
 block discarded – undo
449 449
 	 */
450 450
 	public function testFindL10NDir($app, $expected): void {
451 451
 		$factory = $this->getFactory();
452
-		if (in_array($app, ['settings','files'])) {
452
+		if (in_array($app, ['settings', 'files'])) {
453 453
 			$this->appManager
454 454
 				->method('getAppPath')
455 455
 				->with($app)
456
-				->willReturn(\OC::$SERVERROOT . '/apps/' . $app);
456
+				->willReturn(\OC::$SERVERROOT.'/apps/'.$app);
457 457
 		} else {
458 458
 			$this->appManager
459 459
 				->method('getAppPath')
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
 		$this->config->expects(self::any())
494 494
 			->method('getSystemValue')
495
-			->willReturnCallback(function ($var, $default) use ($defaultLang) {
495
+			->willReturnCallback(function($var, $default) use ($defaultLang) {
496 496
 				if ($var === 'default_language') {
497 497
 					return $defaultLang;
498 498
 				} else {
@@ -528,16 +528,16 @@  discard block
 block discarded – undo
528 528
 		$factory = $this->getFactory(['languageExists', 'findAvailableLanguages', 'respectDefaultLanguage']);
529 529
 		$factory->expects(self::any())
530 530
 			->method('languageExists')
531
-			->willReturnCallback(function ($app, $lang) use ($availableLang) {
531
+			->willReturnCallback(function($app, $lang) use ($availableLang) {
532 532
 				return in_array($lang, $availableLang);
533 533
 			});
534 534
 		$factory->expects(self::any())
535 535
 			->method('findAvailableLanguages')
536
-			->willReturnCallback(function ($app) use ($availableLang) {
536
+			->willReturnCallback(function($app) use ($availableLang) {
537 537
 				return $availableLang;
538 538
 			});
539 539
 		$factory->expects(self::any())
540
-			->method('respectDefaultLanguage')->willReturnCallback(function ($app, $lang) {
540
+			->method('respectDefaultLanguage')->willReturnCallback(function($app, $lang) {
541 541
 				return $lang;
542 542
 			});
543 543
 
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
 		$this->config->expects(self::exactly(2))
564 564
 			->method('getSystemValue')
565 565
 			->willReturnMap([
566
-				['force_language', false, false,],
567
-				['default_language', false, 'cz',],
566
+				['force_language', false, false, ],
567
+				['default_language', false, 'cz', ],
568 568
 			]);
569 569
 		$factory->expects(self::once())
570 570
 			->method('languageExists')
@@ -581,8 +581,8 @@  discard block
 block discarded – undo
581 581
 		$this->config->expects(self::exactly(2))
582 582
 			->method('getSystemValue')
583 583
 			->willReturnMap([
584
-				['force_language', false, false,],
585
-				['default_language', false, false,],
584
+				['force_language', false, false, ],
585
+				['default_language', false, false, ],
586 586
 			]);
587 587
 		$user = $this->createMock(IUser::class);
588 588
 		$this->userSession->expects(self::once())
@@ -603,8 +603,8 @@  discard block
 block discarded – undo
603 603
 		$factory = $this->getFactory(['findAvailableLanguages', 'languageExists']);
604 604
 		$this->config->method('getSystemValue')
605 605
 			->willReturnMap([
606
-				['force_language', false, false,],
607
-				['default_language', false, false,],
606
+				['force_language', false, false, ],
607
+				['default_language', false, false, ],
608 608
 			]);
609 609
 		$user = $this->createMock(IUser::class);
610 610
 		$this->userSession->expects(self::once())
@@ -633,8 +633,8 @@  discard block
 block discarded – undo
633 633
 		$factory = $this->getFactory(['findAvailableLanguages', 'languageExists']);
634 634
 		$this->config->method('getSystemValue')
635 635
 			->willReturnMap([
636
-				['force_language', false, false,],
637
-				['default_language', false, false,],
636
+				['force_language', false, false, ],
637
+				['default_language', false, false, ],
638 638
 			]);
639 639
 		$user = $this->createMock(IUser::class);
640 640
 		$this->userSession->expects(self::once())
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 			->method('languageExists')->willReturn(true);
717 717
 		$factory->expects(self::any())
718 718
 			->method('findAvailableLanguages')
719
-			->willReturnCallback(function ($app) use ($availableLanguages) {
719
+			->willReturnCallback(function($app) use ($availableLanguages) {
720 720
 				return $availableLanguages;
721 721
 			});
722 722
 
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 			]);
730 730
 
731 731
 		$result = $this->invokePrivate($factory, 'getLanguages');
732
-		$commonLanguagesCodes = array_map(function ($lang) {
732
+		$commonLanguagesCodes = array_map(function($lang) {
733 733
 			return $lang['code'];
734 734
 		}, $result['commonLanguages']);
735 735
 
@@ -738,9 +738,9 @@  discard block
 block discarded – undo
738 738
 
739 739
 	public static function languageIteratorRequestProvider(): array {
740 740
 		return [
741
-			[ true, true],
742
-			[ false, true],
743
-			[ false, false],
741
+			[true, true],
742
+			[false, true],
743
+			[false, false],
744 744
 		];
745 745
 	}
746 746
 
Please login to merge, or discard this patch.
tests/lib/Updater/ChangesCheckTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public static function changesXMLProvider(): array {
106 106
 		return [
107
-			[ # 0 - full example
107
+			[# 0 - full example
108 108
 				'<?xml version="1.0" encoding="utf-8" ?>
109 109
 <release xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
110 110
          xsi:noNamespaceSchemaLocation="https://updates.nextcloud.com/changelog_server/schema.xsd"
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 					],
162 162
 				]
163 163
 			],
164
-			[ # 1- admin part not translated
164
+			[# 1- admin part not translated
165 165
 				'<?xml version="1.0" encoding="utf-8" ?>
166 166
 <release xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
167 167
          xsi:noNamespaceSchemaLocation="https://updates.nextcloud.com/changelog_server/schema.xsd"
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 					],
213 213
 				]
214 214
 			],
215
-			[ # 2 - minimal set
215
+			[# 2 - minimal set
216 216
 				'<?xml version="1.0" encoding="utf-8" ?>
217 217
 <release xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
218 218
          xsi:noNamespaceSchemaLocation="https://updates.nextcloud.com/changelog_server/schema.xsd"
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 					],
241 241
 				]
242 242
 			],
243
-			[ # 3 - minimal set (procrastinator edition)
243
+			[# 3 - minimal set (procrastinator edition)
244 244
 				'<?xml version="1.0" encoding="utf-8" ?>
245 245
 <release xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
246 246
          xsi:noNamespaceSchemaLocation="https://updates.nextcloud.com/changelog_server/schema.xsd"
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 					],
265 265
 				]
266 266
 			],
267
-			[ # 4 - empty
267
+			[# 4 - empty
268 268
 				'',
269 269
 				[]
270 270
 			],
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
 
334 334
 	public static function changeDataProvider():array {
335 335
 		$testDataFound = $testDataNotFound = self::versionProvider();
336
-		array_walk($testDataFound, static function (&$params) {
336
+		array_walk($testDataFound, static function(&$params) {
337 337
 			$params[] = true;
338 338
 		});
339
-		array_walk($testDataNotFound, static function (&$params) {
339
+		array_walk($testDataNotFound, static function(&$params) {
340 340
 			$params[] = false;
341 341
 		});
342 342
 		return array_merge($testDataFound, $testDataNotFound);
Please login to merge, or discard this patch.
tests/lib/DB/MigrationsTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
  * @package Test\DB
42 42
  */
43 43
 class MigrationsTest extends \Test\TestCase {
44
-	private MigrationService|MockObject $migrationService;
45
-	private MockObject|IDBConnection $db;
44
+	private MigrationService | MockObject $migrationService;
45
+	private MockObject | IDBConnection $db;
46 46
 	private IAppManager $appManager;
47 47
 
48 48
 	protected function setUp(): void {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function testGetters(): void {
59 59
 		$this->assertEquals('testing', $this->migrationService->getApp());
60
-		$this->assertEquals(\OC::$SERVERROOT . '/apps/testing/lib/Migration', $this->migrationService->getMigrationsDirectory());
60
+		$this->assertEquals(\OC::$SERVERROOT.'/apps/testing/lib/Migration', $this->migrationService->getMigrationsDirectory());
61 61
 		$this->assertEquals('OCA\Testing\Migration', $this->migrationService->getMigrationsNamespace());
62 62
 		$this->assertEquals('test_oc_migrations', $this->migrationService->getMigrationsTableName());
63 63
 	}
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		$this->migrationService = new MigrationService('core', $this->db);
67 67
 
68 68
 		$this->assertEquals('core', $this->migrationService->getApp());
69
-		$this->assertEquals(\OC::$SERVERROOT . '/core/Migrations', $this->migrationService->getMigrationsDirectory());
69
+		$this->assertEquals(\OC::$SERVERROOT.'/core/Migrations', $this->migrationService->getMigrationsDirectory());
70 70
 		$this->assertEquals('OC\Core\Migrations', $this->migrationService->getMigrationsNamespace());
71 71
 		$this->assertEquals('test_oc_migrations', $this->migrationService->getMigrationsTableName());
72 72
 	}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		];
235 235
 		$this->migrationService->expects($this->exactly(2))
236 236
 			->method('executeStep')
237
-			->willReturnCallback(function () use (&$calls) {
237
+			->willReturnCallback(function() use (&$calls) {
238 238
 				$expected = array_shift($calls);
239 239
 				$this->assertEquals($expected, func_get_args());
240 240
 			});
@@ -350,9 +350,9 @@  discard block
 block discarded – undo
350 350
 	public function testEnsureOracleConstraintsValidWithPrimaryKeyDefault(): void {
351 351
 		$defaultName = 'PRIMARY';
352 352
 		if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_POSTGRES) {
353
-			$defaultName = \str_repeat('a', 26) . '_' . \str_repeat('b', 30) . '_seq';
353
+			$defaultName = \str_repeat('a', 26).'_'.\str_repeat('b', 30).'_seq';
354 354
 		} elseif ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE) {
355
-			$defaultName = \str_repeat('a', 26) . '_seq';
355
+			$defaultName = \str_repeat('a', 26).'_seq';
356 356
 		}
357 357
 
358 358
 		$index = $this->createMock(Index::class);
@@ -431,9 +431,9 @@  discard block
 block discarded – undo
431 431
 
432 432
 		$defaultName = 'PRIMARY';
433 433
 		if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_POSTGRES) {
434
-			$defaultName = \str_repeat('a', 27) . '_' . \str_repeat('b', 30) . '_seq';
434
+			$defaultName = \str_repeat('a', 27).'_'.\str_repeat('b', 30).'_seq';
435 435
 		} elseif ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE) {
436
-			$defaultName = \str_repeat('a', 27) . '_seq';
436
+			$defaultName = \str_repeat('a', 27).'_seq';
437 437
 		}
438 438
 
439 439
 		$index = $this->createMock(Index::class);
Please login to merge, or discard this patch.
tests/lib/User/AvailabilityCoordinatorTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	private AvailabilityCoordinator $availabilityCoordinator;
27 27
 	private ICacheFactory $cacheFactory;
28 28
 	private ICache $cache;
29
-	private IConfig|MockObject $config;
29
+	private IConfig | MockObject $config;
30 30
 	private AbsenceService $absenceService;
31 31
 	private LoggerInterface $logger;
32
-	private MockObject|TimezoneService $timezoneService;
32
+	private MockObject | TimezoneService $timezoneService;
33 33
 
34 34
 	protected function setUp(): void {
35 35
 		parent::setUp();
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 			->willReturn($absence);
91 91
 
92 92
 		$calls = [
93
-			[$user->getUID() . '_timezone', 'Europe/Berlin', 3600],
93
+			[$user->getUID().'_timezone', 'Europe/Berlin', 3600],
94 94
 			[$user->getUID(), '{"id":"420","startDate":1696111200,"endDate":1696802340,"shortMessage":"Vacation","message":"On vacation","replacementUserId":"batman","replacementUserDisplayName":"Bruce Wayne"}', 300],
95 95
 		];
96 96
 		$this->cache->expects(self::exactly(2))
97 97
 			->method('set')
98
-			->willReturnCallback(static function () use (&$calls): void {
98
+			->willReturnCallback(static function() use (&$calls): void {
99 99
 				$expected = array_shift($calls);
100 100
 				self::assertEquals($expected, func_get_args());
101 101
 			});
Please login to merge, or discard this patch.
tests/lib/Collaboration/Resources/ProviderManagerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 	public function testGetResourceProvidersValidAndInvalidProvider(): void {
78 78
 		$this->serverContainer->expects($this->exactly(2))
79 79
 			->method('query')
80
-			->willReturnCallback(function (string $service) {
80
+			->willReturnCallback(function(string $service) {
81 81
 				if ($service === 'InvalidResourceProvider') {
82 82
 					throw new QueryException('A meaningful error message');
83 83
 				}
Please login to merge, or discard this patch.
tests/Core/Command/Log/FileTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$this->config->method('getSystemValue')
92 92
 			->willReturnMap([
93 93
 				['log_type', 'file', 'log_type_value'],
94
-				['datadirectory', \OC::$SERVERROOT . '/data', '/data/directory/'],
94
+				['datadirectory', \OC::$SERVERROOT.'/data', '/data/directory/'],
95 95
 				['logfile', '/data/directory/nextcloud.log', '/var/log/nextcloud.log'],
96 96
 				['log_rotate_size', 100 * 1024 * 1024, 5 * 1024 * 1024],
97 97
 			]);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		];
104 104
 		$this->consoleOutput->expects($this->exactly(3))
105 105
 			->method('writeln')
106
-			->willReturnCallback(function (string $message) use (&$calls) {
106
+			->willReturnCallback(function(string $message) use (&$calls) {
107 107
 				$expected = array_shift($calls);
108 108
 				$this->assertEquals($expected[0], $message);
109 109
 			});
Please login to merge, or discard this patch.