diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /apps/files_trashbin/tests | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_trashbin/tests')
-rw-r--r-- | apps/files_trashbin/tests/Command/CleanUpTest.php | 12 | ||||
-rw-r--r-- | apps/files_trashbin/tests/StorageTest.php | 16 | ||||
-rw-r--r-- | apps/files_trashbin/tests/TrashbinTest.php | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php index 3bfbf2b35fd..a906bf75853 100644 --- a/apps/files_trashbin/tests/Command/CleanUpTest.php +++ b/apps/files_trashbin/tests/Command/CleanUpTest.php @@ -81,12 +81,12 @@ class CleanUpTest extends TestCase { $query->delete($this->trashTable)->execute(); for ($i = 0; $i < 10; $i++) { $query->insert($this->trashTable) - ->values(array( + ->values([ 'id' => $query->expr()->literal('file'.$i), 'timestamp' => $query->expr()->literal($i), 'location' => $query->expr()->literal('.'), 'user' => $query->expr()->literal('user'.$i%2) - ))->execute(); + ])->execute(); } $getAllQuery = $this->dbConnection->getQueryBuilder(); $result = $getAllQuery->select('id') @@ -143,10 +143,10 @@ class CleanUpTest extends TestCase { } public function dataTestRemoveDeletedFiles() { - return array( - array(true), - array(false) - ); + return [ + [true], + [false] + ]; } /** diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php index 6b57d111ea9..6047e488a77 100644 --- a/apps/files_trashbin/tests/StorageTest.php +++ b/apps/files_trashbin/tests/StorageTest.php @@ -145,8 +145,8 @@ class StorageTest extends \Test\TestCase { * isn't. */ public function testCrossStorageDeleteFile() { - $storage2 = new Temporary(array()); - \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage'); + $storage2 = new Temporary([]); + \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage'); $this->userView->file_put_contents('substorage/subfile.txt', 'foo'); $storage2->getScanner()->scan(''); @@ -171,8 +171,8 @@ class StorageTest extends \Test\TestCase { * isn't. */ public function testCrossStorageDeleteFolder() { - $storage2 = new Temporary(array()); - \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage'); + $storage2 = new Temporary([]); + \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage'); $this->userView->mkdir('substorage/folder'); $this->userView->file_put_contents('substorage/folder/subfile.txt', 'bar'); @@ -388,8 +388,8 @@ class StorageTest extends \Test\TestCase { public function testKeepFileAndVersionsWhenMovingFileBetweenStorages() { \OCA\Files_Versions\Hooks::connectHooks(); - $storage2 = new Temporary(array()); - \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage'); + $storage2 = new Temporary([]); + \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage'); // trigger a version (multiple would not work because of the expire logic) $this->userView->file_put_contents('test.txt', 'v1'); @@ -429,8 +429,8 @@ class StorageTest extends \Test\TestCase { public function testKeepFileAndVersionsWhenMovingFolderBetweenStorages() { \OCA\Files_Versions\Hooks::connectHooks(); - $storage2 = new Temporary(array()); - \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage'); + $storage2 = new Temporary([]); + \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage'); // trigger a version (multiple would not work because of the expire logic) $this->userView->file_put_contents('folder/inside.txt', 'v1'); diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 4465bfbab3c..bdcef91e37c 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -270,14 +270,14 @@ class TrashbinTest extends \Test\TestCase { $filesInTrashUser2AfterDelete = OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER2); // user2-1.txt should have been expired - $this->verifyArray($filesInTrashUser2AfterDelete, array('user2-2.txt', 'user1-4.txt')); + $this->verifyArray($filesInTrashUser2AfterDelete, ['user2-2.txt', 'user1-4.txt']); self::loginHelper(self::TEST_TRASHBIN_USER1); // user1-1.txt and user1-3.txt should have been expired $filesInTrashUser1AfterDelete = OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1); - $this->verifyArray($filesInTrashUser1AfterDelete, array('user1-2.txt', 'user1-4.txt')); + $this->verifyArray($filesInTrashUser1AfterDelete, ['user1-2.txt', 'user1-4.txt']); } /** |