aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-01-01 18:04:29 +0100
committerRobin Appelman <icewind@owncloud.com>2013-01-01 18:04:29 +0100
commitb41189de4420ea8a48adaaf7bb59f9227124b70a (patch)
tree9d0c46104770ee54d738c047d672a0854cb8585a /tests
parentf2ca7023e1ece60dc3cebc5cd770c7373f53c93a (diff)
downloadnextcloud-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.php14
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'));
}