diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-10-19 17:18:57 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-10-19 17:18:57 +0200 |
commit | 2895c912910a5a24ce6fae5d487ff8136c7a5042 (patch) | |
tree | d661a84df7c55b4260d9efce06882f8b98364ca9 /tests/lib | |
parent | c530c9c322d9475fbbeccce834ba06083d7ae36a (diff) | |
parent | de55f6afbf1eb4bf858ff61e07c6fa475269bea1 (diff) | |
download | nextcloud-server-2895c912910a5a24ce6fae5d487ff8136c7a5042.tar.gz nextcloud-server-2895c912910a5a24ce6fae5d487ff8136c7a5042.zip |
Merge pull request #17641 from owncloud/fix_objectstore_rename
don't move files in cache twice, fixes renaming for objectstores
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/files/cache/updater.php | 18 | ||||
-rw-r--r-- | tests/lib/files/objectstore/swift.php | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index ea75c8dcd72..e3fa26829b4 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -143,6 +143,24 @@ class Updater extends \Test\TestCase { $this->assertEquals($cached['fileid'], $cachedTarget['fileid']); } + public function testMoveNonExistingOverwrite() { + $this->storage->file_put_contents('bar.txt', 'qwerty'); + $this->updater->update('bar.txt'); + + $cached = $this->cache->get('bar.txt'); + + $this->updater->rename('foo.txt', 'bar.txt'); + + $this->assertFalse($this->cache->inCache('foo.txt')); + $this->assertTrue($this->cache->inCache('bar.txt')); + + $cachedTarget = $this->cache->get('bar.txt'); + $this->assertEquals($cached['etag'], $cachedTarget['etag']); + $this->assertEquals($cached['mtime'], $cachedTarget['mtime']); + $this->assertEquals($cached['size'], $cachedTarget['size']); + $this->assertEquals($cached['fileid'], $cachedTarget['fileid']); + } + public function testNewFileDisabled() { $this->storage->file_put_contents('foo.txt', 'bar'); $this->assertFalse($this->cache->inCache('foo.txt')); diff --git a/tests/lib/files/objectstore/swift.php b/tests/lib/files/objectstore/swift.php index 136d8d18039..6d59078aa7c 100644 --- a/tests/lib/files/objectstore/swift.php +++ b/tests/lib/files/objectstore/swift.php @@ -99,6 +99,10 @@ class Swift extends \Test\Files\Storage\Storage { } } + public function testCheckUpdate() { + $this->markTestSkipped('Detecting external changes is not supported on object storages'); + } + /** * @dataProvider copyAndMoveProvider */ |