@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | * Cannot be mocked, because functions like getLoginName are magic functions. |
| 136 | 136 | * To be able to set internal properties, we have to use the real class here. |
| 137 | 137 | */ |
| 138 | - [$encrypted, $privateKey,] = $this->getOpenSSLEncryptedPublicAndPrivateKey('test'); |
|
| 138 | + [$encrypted, $privateKey, ] = $this->getOpenSSLEncryptedPublicAndPrivateKey('test'); |
|
| 139 | 139 | $loginFlowV2 = new LoginFlowV2(); |
| 140 | 140 | $loginFlowV2->setLoginName('test'); |
| 141 | 141 | $loginFlowV2->setServer('test'); |
| 142 | - $loginFlowV2->setAppPassword('broken#' . $encrypted); |
|
| 142 | + $loginFlowV2->setAppPassword('broken#'.$encrypted); |
|
| 143 | 143 | $loginFlowV2->setPrivateKey('encrypted(test)'); |
| 144 | 144 | |
| 145 | 145 | $this->crypto->expects($this->once()) |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | $this->config->expects($this->exactly(1)) |
| 254 | 254 | ->method('getSystemValue') |
| 255 | - ->willReturnCallback(function ($key) use ($allowedClients) { |
|
| 255 | + ->willReturnCallback(function($key) use ($allowedClients) { |
|
| 256 | 256 | // Note: \OCP\IConfig::getSystemValue returns either an array or string. |
| 257 | 257 | return $key == 'core.login_flow_v2.allowed_user_agents' ? $allowedClients : ''; |
| 258 | 258 | }); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | $this->config->expects($this->exactly(1)) |
| 280 | 280 | ->method('getSystemValue') |
| 281 | - ->willReturnCallback(function ($key) use ($allowedClients) { |
|
| 281 | + ->willReturnCallback(function($key) use ($allowedClients) { |
|
| 282 | 282 | // Note: \OCP\IConfig::getSystemValue returns either an array or string. |
| 283 | 283 | return $key == 'core.login_flow_v2.allowed_user_agents' ? $allowedClients : ''; |
| 284 | 284 | }); |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | $this->secureRandom->expects($this->once()) |
| 354 | 354 | ->method('generate') |
| 355 | - ->with(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS) |
|
| 355 | + ->with(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS) |
|
| 356 | 356 | ->willReturn('test_pass'); |
| 357 | 357 | |
| 358 | 358 | // session token |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | public function testCreateTokens(): void { |
| 432 | 432 | $this->config->expects($this->exactly(2)) |
| 433 | 433 | ->method('getSystemValue') |
| 434 | - ->willReturnCallback(function ($key) { |
|
| 434 | + ->willReturnCallback(function($key) { |
|
| 435 | 435 | // Note: \OCP\IConfig::getSystemValue returns either an array or string. |
| 436 | 436 | return $key == 'openssl' ? [] : ''; |
| 437 | 437 | }); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | #[\PHPUnit\Framework\Attributes\Before()] |
| 31 | 31 | public function setupTestPdf(): void { |
| 32 | 32 | $fileContents = file_get_contents( |
| 33 | - __DIR__ . '/../../../data/test.pdf' |
|
| 33 | + __DIR__.'/../../../data/test.pdf' |
|
| 34 | 34 | ); |
| 35 | 35 | $this->testPdf = new InMemoryFile('test.pdf', $fileContents); |
| 36 | 36 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function testGetContent(): void { |
| 83 | 83 | self::assertEquals( |
| 84 | - file_get_contents(__DIR__ . '/../../../data/test.pdf'), |
|
| 84 | + file_get_contents(__DIR__.'/../../../data/test.pdf'), |
|
| 85 | 85 | $this->testPdf->getContent() |
| 86 | 86 | ); |
| 87 | 87 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $this->logger = $this->createMock(LoggerInterface::class); |
| 56 | 56 | $this->config = Server::get(IConfig::class); |
| 57 | 57 | $dbPrefix = $this->config->getSystemValueString('dbtableprefix'); |
| 58 | - $this->tableName = $this->getUniqueID($dbPrefix . '_collation_test'); |
|
| 58 | + $this->tableName = $this->getUniqueID($dbPrefix.'_collation_test'); |
|
| 59 | 59 | $this->connection->prepare("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci")->execute(); |
| 60 | 60 | |
| 61 | 61 | $this->repair = new TestCollationRepair($this->config, $this->logger, $this->connection, false); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $this->l10n = $this->createMock(IL10N::class); |
| 32 | 32 | $this->l10n->expects($this->any()) |
| 33 | 33 | ->method('t') |
| 34 | - ->willReturnCallback(function ($message, array $replace) { |
|
| 34 | + ->willReturnCallback(function($message, array $replace) { |
|
| 35 | 35 | return vsprintf($message, $replace); |
| 36 | 36 | }); |
| 37 | 37 | $this->check = new AppDirsWithDifferentOwner( |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | * there are no directories with different owners than the current user. |
| 47 | 47 | */ |
| 48 | 48 | public function testAppDirectoryOwnersOk(): void { |
| 49 | - $tempDir = tempnam(sys_get_temp_dir(), 'apps') . 'dir'; |
|
| 49 | + $tempDir = tempnam(sys_get_temp_dir(), 'apps').'dir'; |
|
| 50 | 50 | mkdir($tempDir); |
| 51 | - mkdir($tempDir . DIRECTORY_SEPARATOR . 'app1'); |
|
| 52 | - mkdir($tempDir . DIRECTORY_SEPARATOR . 'app2'); |
|
| 53 | - $this->dirsToRemove[] = $tempDir . DIRECTORY_SEPARATOR . 'app1'; |
|
| 54 | - $this->dirsToRemove[] = $tempDir . DIRECTORY_SEPARATOR . 'app2'; |
|
| 51 | + mkdir($tempDir.DIRECTORY_SEPARATOR.'app1'); |
|
| 52 | + mkdir($tempDir.DIRECTORY_SEPARATOR.'app2'); |
|
| 53 | + $this->dirsToRemove[] = $tempDir.DIRECTORY_SEPARATOR.'app1'; |
|
| 54 | + $this->dirsToRemove[] = $tempDir.DIRECTORY_SEPARATOR.'app2'; |
|
| 55 | 55 | $this->dirsToRemove[] = $tempDir; |
| 56 | 56 | \OC::$APPSROOTS = [ |
| 57 | 57 | [ |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * It's expected that no error happens since the check shouldn't apply. |
| 72 | 72 | */ |
| 73 | 73 | public function testAppDirectoryOwnersNotWritable(): void { |
| 74 | - $tempDir = tempnam(sys_get_temp_dir(), 'apps') . 'dir'; |
|
| 74 | + $tempDir = tempnam(sys_get_temp_dir(), 'apps').'dir'; |
|
| 75 | 75 | \OC::$APPSROOTS = [ |
| 76 | 76 | [ |
| 77 | 77 | 'path' => $tempDir, |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | use PHPUnit\Framework\Assert; |
| 10 | 10 | |
| 11 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
| 11 | +require __DIR__.'/../../vendor/autoload.php'; |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Trashbin functions |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | $path = $this->getFullTrashPath($user, $path); |
| 68 | 68 | $client = $this->getSabreClient($user); |
| 69 | 69 | |
| 70 | - $results = $client->propfind($this->makeSabrePath($user, 'trash' . $path, 'trashbin'), [ |
|
| 70 | + $results = $client->propfind($this->makeSabrePath($user, 'trash'.$path, 'trashbin'), [ |
|
| 71 | 71 | '{http://nextcloud.org/ns}trashbin-filename', |
| 72 | 72 | '{http://nextcloud.org/ns}trashbin-original-location', |
| 73 | 73 | '{http://nextcloud.org/ns}trashbin-deletion-time' |
| 74 | 74 | ], 1); |
| 75 | - $results = array_filter($results, function (array $item) { |
|
| 75 | + $results = array_filter($results, function(array $item) { |
|
| 76 | 76 | return isset($item['{http://nextcloud.org/ns}trashbin-filename']); |
| 77 | 77 | }); |
| 78 | 78 | if ($path !== '' && $path !== '/') { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function checkTrashContents($user, $folder, $expectedElements) { |
| 91 | 91 | $elementList = $this->listTrashbinFolder($user, $folder); |
| 92 | - $trashContent = array_filter(array_map(function (array $item) { |
|
| 92 | + $trashContent = array_filter(array_map(function(array $item) { |
|
| 93 | 93 | return $item['{http://nextcloud.org/ns}trashbin-filename']; |
| 94 | 94 | }, $elementList)); |
| 95 | 95 | if ($expectedElements instanceof \Behat\Gherkin\Node\TableNode) { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | foreach ($elementsSimplified as $expectedElement) { |
| 99 | 99 | $expectedElement = ltrim($expectedElement, '/'); |
| 100 | 100 | if (array_search($expectedElement, $trashContent) === false) { |
| 101 | - Assert::fail("$expectedElement" . ' is not in trash listing'); |
|
| 101 | + Assert::fail("$expectedElement".' is not in trash listing'); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -117,12 +117,12 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | $name = basename($file); |
| 119 | 119 | $elementList = $this->listTrashbinFolder($user, $parent); |
| 120 | - $trashContent = array_filter(array_map(function (array $item) { |
|
| 120 | + $trashContent = array_filter(array_map(function(array $item) { |
|
| 121 | 121 | return $item['{http://nextcloud.org/ns}trashbin-filename']; |
| 122 | 122 | }, $elementList)); |
| 123 | 123 | |
| 124 | 124 | if (array_search($name, array_values($trashContent)) === false) { |
| 125 | - Assert::fail("$name" . ' is not in trash listing'); |
|
| 125 | + Assert::fail("$name".' is not in trash listing'); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function restoreFromTrash($user, $file) { |
| 146 | 146 | $file = $this->getFullTrashPath($user, $file); |
| 147 | - $url = $this->makeSabrePath($user, 'trash' . $file, 'trashbin'); |
|
| 147 | + $url = $this->makeSabrePath($user, 'trash'.$file, 'trashbin'); |
|
| 148 | 148 | $client = $this->getSabreClient($user); |
| 149 | 149 | $response = $client->request('MOVE', $url, null, [ |
| 150 | - 'Destination' => $this->makeSabrePath($user, 'restore/' . basename($file), 'trashbin'), |
|
| 150 | + 'Destination' => $this->makeSabrePath($user, 'restore/'.basename($file), 'trashbin'), |
|
| 151 | 151 | ]); |
| 152 | 152 | Assert::assertEquals(201, $response['statusCode']); |
| 153 | 153 | return; |