diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-01 18:04:29 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-01 18:04:29 +0100 |
commit | b41189de4420ea8a48adaaf7bb59f9227124b70a (patch) | |
tree | 9d0c46104770ee54d738c047d672a0854cb8585a /tests | |
parent | f2ca7023e1ece60dc3cebc5cd770c7373f53c93a (diff) | |
download | nextcloud-server-b41189de4420ea8a48adaaf7bb59f9227124b70a.tar.gz nextcloud-server-b41189de4420ea8a48adaaf7bb59f9227124b70a.zip |
Cache: allow storage backends to overwrite Watcher
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/watcher.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/lib/files/cache/watcher.php b/tests/lib/files/cache/watcher.php index 07c8ac3640c..e8a1689cab0 100644 --- a/tests/lib/files/cache/watcher.php +++ b/tests/lib/files/cache/watcher.php @@ -32,7 +32,7 @@ class Watcher extends \PHPUnit_Framework_TestCase { function testWatcher() { $storage = $this->getTestStorage(); $cache = $storage->getCache(); - $updater = new \OC\Files\Cache\Watcher($storage); + $updater = $storage->getWatcher(); //set the mtime to the past so it can detect an mtime change $cache->put('', array('mtime' => 10)); @@ -66,16 +66,16 @@ class Watcher extends \PHPUnit_Framework_TestCase { public function testFileToFolder() { $storage = $this->getTestStorage(); $cache = $storage->getCache(); - $updater = new \OC\Files\Cache\Watcher($storage); + $updater = $storage->getWatcher(); //set the mtime to the past so it can detect an mtime change $cache->put('', array('mtime' => 10)); $storage->unlink('foo.txt'); - $storage->rename('folder','foo.txt'); + $storage->rename('folder', 'foo.txt'); $updater->checkUpdate(''); - $entry= $cache->get('foo.txt'); + $entry = $cache->get('foo.txt'); $this->assertEquals(-1, $entry['size']); $this->assertEquals('httpd/unix-directory', $entry['mimetype']); $this->assertFalse($cache->inCache('folder')); @@ -83,16 +83,16 @@ class Watcher extends \PHPUnit_Framework_TestCase { $storage = $this->getTestStorage(); $cache = $storage->getCache(); - $updater = new \OC\Files\Cache\Watcher($storage); + $updater = $storage->getWatcher(); //set the mtime to the past so it can detect an mtime change $cache->put('foo.txt', array('mtime' => 10)); $storage->unlink('foo.txt'); - $storage->rename('folder','foo.txt'); + $storage->rename('folder', 'foo.txt'); $updater->checkUpdate('foo.txt'); - $entry= $cache->get('foo.txt'); + $entry = $cache->get('foo.txt'); $this->assertEquals('httpd/unix-directory', $entry['mimetype']); $this->assertTrue($cache->inCache('foo.txt/bar.txt')); } |