[Pkg-owncloud-commits] [owncloud] 29/129: Add tests for double cache rename

David Prévot taffit at moszumanska.debian.org
Thu Nov 5 01:04:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit be9e72084d15a2496035b18afeafd9d0c0302f03
Author: Robin Appelman <icewind at owncloud.com>
Date:   Mon Oct 12 17:11:16 2015 +0200

    Add tests for double cache rename
---
 tests/lib/files/cache/updater.php | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php
index ea75c8d..e3fa268 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'));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list