summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-06-03 17:20:25 +0200
committerJoas Schilling <nickvergessen@gmx.de>2015-06-03 17:20:25 +0200
commitbb0cb0aaec597aa0a79c061166ce8929bcc02fdd (patch)
tree13746fc19d3e866d616b9ee8491a93037ffeb9c7 /tests
parent8d860e564af1e8a5255e6c1ab1d075e2dc1e0e57 (diff)
parent120588dd7a22af9f1e85ad85e192c5aede92b32c (diff)
downloadnextcloud-server-bb0cb0aaec597aa0a79c061166ce8929bcc02fdd.tar.gz
nextcloud-server-bb0cb0aaec597aa0a79c061166ce8929bcc02fdd.zip
Merge pull request #15895 from owncloud/dav-getremoteetag
Get etag from remote OC server
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/storage.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 62fba4c1716..2355009c9bf 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -22,6 +22,8 @@
namespace Test\Files\Storage;
+use OC\Files\Cache\Watcher;
+
abstract class Storage extends \Test\TestCase {
/**
* @var \OC\Files\Storage\Storage instance
@@ -309,6 +311,22 @@ abstract class Storage extends \Test\TestCase {
$this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 5));
}
+ /**
+ * Test whether checkUpdate properly returns false when there was
+ * no change.
+ */
+ public function testCheckUpdate() {
+ if ($this->instance instanceof \OC\Files\Storage\Wrapper\Wrapper) {
+ $this->markTestSkipped('Cannot test update check on wrappers');
+ }
+ $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
+ $watcher = $this->instance->getWatcher();
+ $watcher->setPolicy(Watcher::CHECK_ALWAYS);
+ $this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile));
+ $this->assertTrue($watcher->checkUpdate('/lorem.txt'), 'Update detected');
+ $this->assertFalse($watcher->checkUpdate('/lorem.txt'), 'No update');
+ }
+
public function testUnlink() {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile));