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:
authorC. Montero Luque <cmonteroluque@users.noreply.github.com>2016-04-26 23:46:23 +0300
committerC. Montero Luque <cmonteroluque@users.noreply.github.com>2016-04-26 23:46:23 +0300
commitfe753fe722642ccb42f73589d6f9f81ccb5bd983 (patch)
tree2c3909c19b5cd762f112e7cb61cf9ca95aea78da /tests
parent884c8215f800e4753e71a03df26f26459f480964 (diff)
parent98820f2af3f31400097192ed7458c40e607789b4 (diff)
Merge branch 'stable9' into local-invalid-9
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());
+ }
}