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 /tests/lib/Files/Cache/WatcherTest.php | |
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 'tests/lib/Files/Cache/WatcherTest.php')
-rw-r--r-- | tests/lib/Files/Cache/WatcherTest.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/lib/Files/Cache/WatcherTest.php b/tests/lib/Files/Cache/WatcherTest.php index 18f0ebe98a9..2a42a9e603f 100644 --- a/tests/lib/Files/Cache/WatcherTest.php +++ b/tests/lib/Files/Cache/WatcherTest.php @@ -20,7 +20,7 @@ class WatcherTest extends \Test\TestCase { /** * @var \OC\Files\Storage\Storage[] $storages */ - private $storages = array(); + private $storages = []; protected function setUp(): void { parent::setUp(); @@ -49,7 +49,7 @@ class WatcherTest extends \Test\TestCase { $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE); //set the mtime to the past so it can detect an mtime change - $cache->put('', array('storage_mtime' => 10)); + $cache->put('', ['storage_mtime' => 10]); $this->assertTrue($cache->inCache('folder/bar.txt')); $this->assertTrue($cache->inCache('folder/bar2.txt')); @@ -61,7 +61,7 @@ class WatcherTest extends \Test\TestCase { $cachedData = $cache->get('bar.test'); $this->assertEquals(3, $cachedData['size']); - $cache->put('bar.test', array('storage_mtime' => 10)); + $cache->put('bar.test', ['storage_mtime' => 10]); $storage->file_put_contents('bar.test', 'test data'); // make sure that PHP can read the new size correctly @@ -71,7 +71,7 @@ class WatcherTest extends \Test\TestCase { $cachedData = $cache->get('bar.test'); $this->assertEquals(9, $cachedData['size']); - $cache->put('folder', array('storage_mtime' => 10)); + $cache->put('folder', ['storage_mtime' => 10]); $storage->unlink('folder/bar2.txt'); $updater->checkUpdate('folder'); @@ -90,7 +90,7 @@ class WatcherTest extends \Test\TestCase { $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE); //set the mtime to the past so it can detect an mtime change - $cache->put('', array('storage_mtime' => 10)); + $cache->put('', ['storage_mtime' => 10]); $storage->unlink('foo.txt'); $storage->rename('folder', 'foo.txt'); @@ -107,7 +107,7 @@ class WatcherTest extends \Test\TestCase { $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE); //set the mtime to the past so it can detect an mtime change - $cache->put('foo.txt', array('storage_mtime' => 10)); + $cache->put('foo.txt', ['storage_mtime' => 10]); $storage->unlink('foo.txt'); $storage->rename('folder', 'foo.txt'); @@ -124,14 +124,14 @@ class WatcherTest extends \Test\TestCase { $updater = $storage->getWatcher(); //set the mtime to the past so it can detect an mtime change - $cache->put('foo.txt', array('storage_mtime' => 10)); + $cache->put('foo.txt', ['storage_mtime' => 10]); $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_NEVER); $storage->file_put_contents('foo.txt', 'q'); $this->assertFalse($updater->checkUpdate('foo.txt')); - $cache->put('foo.txt', array('storage_mtime' => 20)); + $cache->put('foo.txt', ['storage_mtime' => 20]); $storage->file_put_contents('foo.txt', 'w'); $this->assertFalse($updater->checkUpdate('foo.txt')); } @@ -142,14 +142,14 @@ class WatcherTest extends \Test\TestCase { $updater = $storage->getWatcher(); //set the mtime to the past so it can detect an mtime change - $cache->put('foo.txt', array('storage_mtime' => 10)); + $cache->put('foo.txt', ['storage_mtime' => 10]); $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE); $storage->file_put_contents('foo.txt', 'q'); $this->assertTrue($updater->checkUpdate('foo.txt')); - $cache->put('foo.txt', array('storage_mtime' => 20)); + $cache->put('foo.txt', ['storage_mtime' => 20]); $storage->file_put_contents('foo.txt', 'w'); $this->assertFalse($updater->checkUpdate('foo.txt')); } @@ -160,14 +160,14 @@ class WatcherTest extends \Test\TestCase { $updater = $storage->getWatcher(); //set the mtime to the past so it can detect an mtime change - $cache->put('foo.txt', array('storage_mtime' => 10)); + $cache->put('foo.txt', ['storage_mtime' => 10]); $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ALWAYS); $storage->file_put_contents('foo.txt', 'q'); $this->assertTrue($updater->checkUpdate('foo.txt')); - $cache->put('foo.txt', array('storage_mtime' => 20)); + $cache->put('foo.txt', ['storage_mtime' => 20]); $storage->file_put_contents('foo.txt', 'w'); $this->assertTrue($updater->checkUpdate('foo.txt')); } @@ -177,7 +177,7 @@ class WatcherTest extends \Test\TestCase { * @return \OC\Files\Storage\Storage */ private function getTestStorage($scan = true) { - $storage = new \OC\Files\Storage\Temporary(array()); + $storage = new \OC\Files\Storage\Temporary([]); $textData = "dummy file data\n"; $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $storage->mkdir('folder'); |