[Pkg-owncloud-commits] [owncloud] 08/118: add some tests for disabled updater

David Prévot taffit at moszumanska.debian.org
Fri Mar 27 22:13:06 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 c0a4affe00a3b58460d2216629228ab5df00f812
Author: Robin Appelman <icewind at owncloud.com>
Date:   Fri Feb 27 15:49:17 2015 +0100

    add some tests for disabled updater
---
 tests/lib/files/cache/updater.php | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php
index 01b036d..970af2e 100644
--- a/tests/lib/files/cache/updater.php
+++ b/tests/lib/files/cache/updater.php
@@ -146,4 +146,34 @@ class Updater extends \Test\TestCase {
 		$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'));
+
+		$this->updater->disable();
+		$this->updater->update('/foo.txt');
+
+		$this->assertFalse($this->cache->inCache('foo.txt'));
+	}
+
+	public function testMoveDisabled() {
+		$this->storage->file_put_contents('foo.txt', 'qwerty');
+		$this->updater->update('foo.txt');
+
+		$this->assertTrue($this->cache->inCache('foo.txt'));
+		$this->assertFalse($this->cache->inCache('bar.txt'));
+		$cached = $this->cache->get('foo.txt');
+
+		$this->storage->rename('foo.txt', 'bar.txt');
+
+		$this->assertTrue($this->cache->inCache('foo.txt'));
+		$this->assertFalse($this->cache->inCache('bar.txt'));
+
+		$this->updater->disable();
+		$this->updater->rename('foo.txt', 'bar.txt');
+
+		$this->assertTrue($this->cache->inCache('foo.txt'));
+		$this->assertFalse($this->cache->inCache('bar.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