summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-28 11:43:45 +0100
committerRobin Appelman <icewind@owncloud.com>2012-10-28 11:43:45 +0100
commitb07672821bcdc1ce31e169d691cf9a94ad5fad21 (patch)
treebea32eb6060a842b361e596b3c20c67d0c85c88e /tests/lib/files/view.php
parentfba7be1194fd31da2cb71c56d0cd8e6ab1c1ff49 (diff)
downloadnextcloud-server-b07672821bcdc1ce31e169d691cf9a94ad5fad21.tar.gz
nextcloud-server-b07672821bcdc1ce31e169d691cf9a94ad5fad21.zip
check for changes when using the cache api
Diffstat (limited to 'tests/lib/files/view.php')
-rw-r--r--tests/lib/files/view.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 8ff03963e40..fa562cb15cd 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -146,6 +146,23 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertEquals(3, count($folderView->searchByMime('text')));
}
+ function testWatcher() {
+ $storage1 = $this->getTestStorage();
+ \OC\Files\Filesystem::mount($storage1, array(), '/');
+
+ $rootView = new \OC\Files\View('');
+
+ $cachedData = $rootView->getFileInfo('foo.txt');
+ $this->assertEquals(16, $cachedData['size']);
+
+ $rootView->putFileInfo('foo.txt', array('mtime' => 10));
+ $storage1->file_put_contents('foo.txt', 'foo');
+ clearstatcache();
+
+ $cachedData = $rootView->getFileInfo('foo.txt');
+ $this->assertEquals(3, $cachedData['size']);
+ }
+
/**
* @param bool $scan
* @return \OC\Files\Storage\Storage