diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-02-27 15:49:17 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-02-27 17:14:17 +0100 |
commit | 89735ab22b3ca4cf1dedb4de0e9424324281edcc (patch) | |
tree | 1bfc0cf7695a0e614cf6228a8d4013042c17fb4d /tests | |
parent | 6f000ffc7b44e851210a2df75e2bf11ed2c1d10a (diff) | |
download | nextcloud-server-89735ab22b3ca4cf1dedb4de0e9424324281edcc.tar.gz nextcloud-server-89735ab22b3ca4cf1dedb4de0e9424324281edcc.zip |
add some tests for disabled updater
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/updater.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index 01b036de5d8..970af2e68df 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')); + } } |