Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-04-25 18:23:48 +0300
committerRobin Appelman <icewind@owncloud.com>2016-04-25 19:29:57 +0300
commit1397d9a93c0b86f412688825871cbbe8b841f9b5 (patch)
treeaba9a6178aa71ad53137f9e5cc6c3788cce97e14 /tests
parent5925ab99f89433512d4c2d928465736943213727 (diff)
triger the propagator from the command line scanner
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/utils/scanner.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lib/files/utils/scanner.php b/tests/lib/files/utils/scanner.php
index 7779e2778cb..1220c57e962 100644
--- a/tests/lib/files/utils/scanner.php
+++ b/tests/lib/files/utils/scanner.php
@@ -163,4 +163,28 @@ class Scanner extends \Test\TestCase {
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
$scanner->scan($invalidPath);
}
+
+ public function testPropagateEtag() {
+ $storage = new Temporary(array());
+ $mount = new MountPoint($storage, '');
+ Filesystem::getMountManager()->addMount($mount);
+ $cache = $storage->getCache();
+
+ $storage->mkdir('folder');
+ $storage->file_put_contents('folder/bar.txt', 'qwerty');
+ $storage->touch('folder/bar.txt', time() - 200);
+
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
+ $scanner->addMount($mount);
+
+ $scanner->scan('');
+ $this->assertTrue($cache->inCache('folder/bar.txt'));
+ $oldRoot = $cache->get('');
+
+ $storage->file_put_contents('folder/bar.txt', 'qwerty');
+ $scanner->scan('');
+ $newRoot = $cache->get('');
+
+ $this->assertNotEquals($oldRoot->getEtag(), $newRoot->getEtag());
+ }
}