Completed
Push — master ( ca1fc2...aba39c )
by Joas
31:19 queued 16s
created
tests/Core/Command/Preview/RepairTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		$this->input = $this->createMock(InputInterface::class);
59 59
 		$this->input->expects($this->any())
60 60
 			->method('getOption')
61
-			->willReturnCallback(function ($parameter) {
61
+			->willReturnCallback(function($parameter) {
62 62
 				if ($parameter === 'batch') {
63 63
 					return true;
64 64
 				}
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 			->willReturn($outputFormatter);
80 80
 		$this->output->expects($this->any())
81 81
 			->method('writeln')
82
-			->willReturnCallback(function ($line) use ($self) {
83
-				$self->outputLines .= $line . "\n";
82
+			->willReturnCallback(function($line) use ($self) {
83
+				$self->outputLines .= $line."\n";
84 84
 			});
85 85
 	}
86 86
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	public function testEmptyExecute($directoryNames, $expectedOutput): void {
117 117
 		$previewFolder = $this->getMockBuilder(Folder::class)
118 118
 			->getMock();
119
-		$directories = array_map(function ($element) {
119
+		$directories = array_map(function($element) {
120 120
 			$dir = $this->getMockBuilder(Folder::class)
121 121
 				->getMock();
122 122
 			$dir->expects($this->any())
Please login to merge, or discard this patch.
tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		];
66 66
 		$this->consoleOutput->expects($this->exactly(2))
67 67
 			->method('writeln')
68
-			->willReturnCallback(function ($message) use (&$calls) {
68
+			->willReturnCallback(function($message) use (&$calls) {
69 69
 				$expected = array_shift($calls);
70 70
 				$this->assertStringContainsString($expected, $message);
71 71
 			});
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		];
111 111
 		$this->consoleOutput->expects($this->exactly(4))
112 112
 			->method('writeln')
113
-			->willReturnCallback(function ($message) use (&$calls) {
113
+			->willReturnCallback(function($message) use (&$calls) {
114 114
 				$expected = array_shift($calls);
115 115
 				$this->assertStringContainsString($expected, $message);
116 116
 			});
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		];
164 164
 		$this->consoleOutput->expects($this->exactly(3))
165 165
 			->method('writeln')
166
-			->willReturnCallback(function ($message) use (&$calls) {
166
+			->willReturnCallback(function($message) use (&$calls) {
167 167
 				$expected = array_shift($calls);
168 168
 				$this->assertStringContainsString($expected, $message);
169 169
 			});
Please login to merge, or discard this patch.
tests/Core/Controller/LoginControllerTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$this->l->expects($this->any())
101 101
 			->method('t')
102
-			->willReturnCallback(function ($text, $parameters = []) {
102
+			->willReturnCallback(function($text, $parameters = []) {
103 103
 				return vsprintf($text, $parameters);
104 104
 			});
105 105
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		];
280 280
 		$this->initialState->expects($this->exactly(13))
281 281
 			->method('provideInitialState')
282
-			->willReturnCallback(function () use (&$calls) {
282
+			->willReturnCallback(function() use (&$calls) {
283 283
 				$expected = array_shift($calls);
284 284
 				if (!empty($expected)) {
285 285
 					$this->assertEquals($expected, func_get_args());
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		];
317 317
 		$this->initialState->expects($this->exactly(14))
318 318
 			->method('provideInitialState')
319
-			->willReturnCallback(function () use (&$calls) {
319
+			->willReturnCallback(function() use (&$calls) {
320 320
 				$expected = array_shift($calls);
321 321
 				if (!empty($expected)) {
322 322
 					$this->assertEquals($expected, func_get_args());
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 		];
397 397
 		$this->initialState->expects($this->exactly(13))
398 398
 			->method('provideInitialState')
399
-			->willReturnCallback(function () use (&$calls) {
399
+			->willReturnCallback(function() use (&$calls) {
400 400
 				$expected = array_shift($calls);
401 401
 				if (!empty($expected)) {
402 402
 					$this->assertEquals($expected, func_get_args());
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 		];
460 460
 		$this->initialState->expects($this->exactly(13))
461 461
 			->method('provideInitialState')
462
-			->willReturnCallback(function () use (&$calls) {
462
+			->willReturnCallback(function() use (&$calls) {
463 463
 				$expected = array_shift($calls);
464 464
 				if (!empty($expected)) {
465 465
 					$this->assertEquals($expected, func_get_args());
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 		$loginChain->expects($this->once())
671 671
 			->method('process')
672 672
 			->with($this->equalTo($loginData))
673
-			->willReturnCallback(function (LoginData $data) use ($loginResult) {
673
+			->willReturnCallback(function(LoginData $data) use ($loginResult) {
674 674
 				$data->setUsername('john');
675 675
 				return $loginResult;
676 676
 			});
Please login to merge, or discard this patch.
tests/Core/Controller/LostControllerTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$this->l10n
101 101
 			->expects($this->any())
102 102
 			->method('t')
103
-			->willReturnCallback(function ($text, $parameters = []) {
103
+			->willReturnCallback(function($text, $parameters = []) {
104 104
 				return vsprintf($text, $parameters);
105 105
 			});
106 106
 		$this->defaults = $this->createMock(Defaults::class);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		$this->initialState
181 181
 			->expects($this->exactly(2))
182 182
 			->method('provideInitialState')
183
-			->willReturnCallback(function () use (&$calls) {
183
+			->willReturnCallback(function() use (&$calls) {
184 184
 				$expected = array_shift($calls);
185 185
 				$this->assertEquals($expected, func_get_args());
186 186
 			});
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 		$this->eventDispatcher
462 462
 			->expects($this->exactly(2))
463 463
 			->method('dispatchTyped')
464
-			->willReturnCallback(function () use (&$calls) {
464
+			->willReturnCallback(function() use (&$calls) {
465 465
 				$expected = array_shift($calls);
466 466
 				$this->assertEquals($expected, func_get_args());
467 467
 			});
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 		$encryptionModule = $this->createMock(IEncryptionModule::class);
592 592
 		$encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(true);
593 593
 		$this->encryptionManager->expects($this->once())->method('getEncryptionModules')
594
-			->willReturn([0 => ['callback' => function () use ($encryptionModule) {
594
+			->willReturn([0 => ['callback' => function() use ($encryptionModule) {
595 595
 				return $encryptionModule;
596 596
 			}]]);
597 597
 		$response = $this->lostController->setPassword('myToken', 'user', 'newpass', false);
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 		$encryptionModule = $this->createMock(IEncryptionModule::class);
604 604
 		$encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(false);
605 605
 		$this->encryptionManager->expects($this->once())->method('getEncryptionModules')
606
-			->willReturn([0 => ['callback' => function () use ($encryptionModule) {
606
+			->willReturn([0 => ['callback' => function() use ($encryptionModule) {
607 607
 				return $encryptionModule;
608 608
 			}]]);
609 609
 		$this->config->method('getUserValue')
Please login to merge, or discard this patch.
tests/Core/Controller/WipeControllerTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
 	public static function dataTest(): array {
37 37
 		return [
38 38
 			// valid token, could perform operation, valid result
39
-			[ true,  true,  true],
40
-			[ true, false, false],
41
-			[false,  true, false],
39
+			[true, true, true],
40
+			[true, false, false],
41
+			[false, true, false],
42 42
 			[false, false, false],
43 43
 		];
44 44
 	}
Please login to merge, or discard this patch.
tests/Core/Controller/AutoCompleteControllerTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public static function searchDataProvider(): array {
46 46
 		return [
47
-			[ #0 – regular search
47
+			[#0 – regular search
48 48
 				// searchResults
49 49
 				[
50 50
 					'exact' => [
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 				],
59 59
 				// expected
60 60
 				[
61
-					[ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
62
-					[ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
61
+					['id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
62
+					['id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
63 63
 				],
64 64
 				'',
65 65
 				'files',
66 66
 				'42',
67 67
 				null
68 68
 			],
69
-			[ #1 – missing itemtype and id
69
+			[#1 – missing itemtype and id
70 70
 				[
71 71
 					'exact' => [
72 72
 						'users' => [],
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
 				],
80 80
 				// expected
81 81
 				[
82
-					[ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
83
-					[ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
82
+					['id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
83
+					['id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
84 84
 				],
85 85
 				'',
86 86
 				null,
87 87
 				null,
88 88
 				null
89 89
 			],
90
-			[ #2 – with sorter
90
+			[#2 – with sorter
91 91
 				[
92 92
 					'exact' => [
93 93
 						'users' => [],
@@ -100,15 +100,15 @@  discard block
 block discarded – undo
100 100
 				],
101 101
 				// expected
102 102
 				[
103
-					[ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
104
-					[ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
103
+					['id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
104
+					['id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
105 105
 				],
106 106
 				'',
107 107
 				'files',
108 108
 				'42',
109 109
 				'karma|bus-factor'
110 110
 			],
111
-			[ #3 – exact Match
111
+			[#3 – exact Match
112 112
 				[
113 113
 					'exact' => [
114 114
 						'users' => [
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
 					],
122 122
 				],
123 123
 				[
124
-					[ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
125
-					[ 'id' => 'bobby', 'label' => 'Robert R.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
124
+					['id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
125
+					['id' => 'bobby', 'label' => 'Robert R.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''],
126 126
 				],
127 127
 				'bob',
128 128
 				'files',
129 129
 				'42',
130 130
 				null
131 131
 			],
132
-			[ #4 – with unique name
132
+			[#4 – with unique name
133 133
 				[
134 134
 					'exact' => [
135 135
 						'users' => [],
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 				],
143 143
 				// expected
144 144
 				[
145
-					[ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => '[email protected]'],
146
-					[ 'id' => 'alicea', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => '[email protected]'],
145
+					['id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => '[email protected]'],
146
+					['id' => 'alicea', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => '[email protected]'],
147 147
 				],
148 148
 				'',
149 149
 				'files',
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		$response = $this->controller->get($searchTerm, $itemType, $itemId, $sorter);
169 169
 
170 170
 		$list = $response->getData();
171
-		$this->assertEquals($expected, $list);	// has better error output…
171
+		$this->assertEquals($expected, $list); // has better error output…
172 172
 		$this->assertSame($expected, $list);
173 173
 	}
174 174
 }
Please login to merge, or discard this patch.
tests/Core/Controller/TwoFactorChallengeControllerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@
 block discarded – undo
308 308
 		];
309 309
 		$this->session->expects($this->exactly(2))
310 310
 			->method('set')
311
-			->willReturnCallback(function () use (&$calls) {
311
+			->willReturnCallback(function() use (&$calls) {
312 312
 				$expected = array_shift($calls);
313 313
 				$this->assertEquals($expected, func_get_args());
314 314
 			});
Please login to merge, or discard this patch.
tests/Core/Controller/ClientFlowLoginControllerTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		$this->l10n
63 63
 			->expects($this->any())
64 64
 			->method('t')
65
-			->willReturnCallback(function ($text, $parameters = []) {
65
+			->willReturnCallback(function($text, $parameters = []) {
66 66
 				return vsprintf($text, $parameters);
67 67
 			});
68 68
 		$this->defaults = $this->createMock(Defaults::class);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			->method('generate')
128 128
 			->with(
129 129
 				64,
130
-				ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS
130
+				ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS
131 131
 			)
132 132
 			->willReturn('StateToken');
133 133
 		$this->session
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			->method('generate')
195 195
 			->with(
196 196
 				64,
197
-				ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS
197
+				ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS
198 198
 			)
199 199
 			->willReturn('StateToken');
200 200
 		$this->session
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		];
407 407
 		$this->session
408 408
 			->method('remove')
409
-			->willReturnCallback(function ($key) use (&$calls) {
409
+			->willReturnCallback(function($key) use (&$calls) {
410 410
 				$expected = array_shift($calls);
411 411
 				$this->assertEquals($expected, $key);
412 412
 			});
@@ -432,8 +432,8 @@  discard block
 block discarded – undo
432 432
 		$this->random
433 433
 			->method('generate')
434 434
 			->willReturnMap([
435
-				[72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'],
436
-				[128, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS, 'MyAccessCode'],
435
+				[72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyGeneratedToken'],
436
+				[128, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS, 'MyAccessCode'],
437 437
 			]);
438 438
 		$user = $this->createMock(IUser::class);
439 439
 		$user
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 		$this->eventDispatcher->expects($this->once())
677 677
 			->method('dispatchTyped');
678 678
 
679
-		$expected = new Http\RedirectResponse('nc://login/server:' . $expected . '://example.com&user:MyLoginName&password:MyGeneratedToken');
679
+		$expected = new Http\RedirectResponse('nc://login/server:'.$expected.'://example.com&user:MyLoginName&password:MyGeneratedToken');
680 680
 		$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
681 681
 	}
682 682
 }
Please login to merge, or discard this patch.
tests/Core/Middleware/TwoFactorMiddlewareTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
 		$this->reflector
210 210
 			->method('hasAnnotation')
211
-			->willReturnCallback(function (string $annotation) {
211
+			->willReturnCallback(function(string $annotation) {
212 212
 				return $annotation === 'TwoFactorSetUpDoneRequired';
213 213
 			});
214 214
 		$this->userSession->expects($this->once())
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
 	public static function dataRequires2FASetupDone(): array {
238 238
 		return [
239 239
 			[false, false, false],
240
-			[false,  true,  true],
240
+			[false, true, true],
241 241
 			[true, false, true],
242
-			[true, true,  true],
242
+			[true, true, true],
243 243
 		];
244 244
 	}
245 245
 
Please login to merge, or discard this patch.