diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-03-02 14:53:29 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-03-02 14:53:29 +0100 |
commit | e61aa3723ede98d7a6bd59474279f8cc28359c48 (patch) | |
tree | 6a1c1ff23f04fcbe6d4d42c7b3e54dd1274d3a04 /tests | |
parent | e1f833a6112688845c90ac428d224888537ad423 (diff) | |
parent | 22bc622f9b2488a3c556039096c44d99bc46b1a4 (diff) | |
download | nextcloud-server-e61aa3723ede98d7a6bd59474279f8cc28359c48.tar.gz nextcloud-server-e61aa3723ede98d7a6bd59474279f8cc28359c48.zip |
Merge pull request #14573 from owncloud/enc-migrate-disable-updater
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')); + } } |