diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-03-11 18:18:04 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-03-11 18:18:04 +0300 |
commit | 7e87cdab4a512987e5b6a3f94b340618d40cd5a6 (patch) | |
tree | b2fe899cab1976aed95f63bc056f94a5e709aef0 /tests | |
parent | 5effc4a53a5674ef6138a881e8a6d7c4eb25d293 (diff) | |
parent | 8f23742ca64ee8b7f5b3e147406b83614ab72259 (diff) |
Merge pull request #14669 from owncloud/enc-migrate-disable-updater-stable8
[stable8] Disable the cache updater when doing the encryption migration
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')); + } } |