diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-04-25 17:23:48 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-04-25 17:23:48 +0200 |
commit | 61054df36d942c1a2c5fe7e739b7ad767c81c4c4 (patch) | |
tree | 802a1b6680359afb67fa0b853078bcd8cf6c15ab /tests | |
parent | 632159613447796b5bb7dbe3a17c194573b18b4a (diff) | |
download | nextcloud-server-61054df36d942c1a2c5fe7e739b7ad767c81c4c4.tar.gz nextcloud-server-61054df36d942c1a2c5fe7e739b7ad767c81c4c4.zip |
triger the propagator from the command line scanner
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/utils/scanner.php | 24 |
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()); + } } |