diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-03-08 19:08:07 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-03-17 14:16:13 +0100 |
commit | cfea3ce2d78ba54fdddebf98672ea0dab1ca674b (patch) | |
tree | bf2a86d442af6f28690a5a88a076c28e88703ffd /tests | |
parent | 2c76ee1c8b26bea1720b374862563a0025a51daf (diff) | |
download | nextcloud-server-cfea3ce2d78ba54fdddebf98672ea0dab1ca674b.tar.gz nextcloud-server-cfea3ce2d78ba54fdddebf98672ea0dab1ca674b.zip |
Cache: better rename hook for cache updater
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/updater.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index 7a79f45a203..aaf932c97fe 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -54,6 +54,8 @@ class Updater extends \PHPUnit_Framework_TestCase { Filesystem::clearMounts(); Filesystem::mount($this->storage, array(), '/' . self::$user . '/files'); + \OC_Hook::clear('OC_Filesystem'); + \OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Updater', 'writeHook'); \OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Updater', 'deleteHook'); \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Updater', 'renameHook'); @@ -137,11 +139,10 @@ class Updater extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->cache->inCache('foo.txt')); $this->assertTrue($this->cache->inCache('bar.txt')); $cachedData = $this->cache->get('bar.txt'); - $this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']); + $this->assertEquals($fooCachedData['fileid'], $cachedData['fileid']); $mtime = $cachedData['mtime']; $cachedData = $this->cache->get(''); $this->assertEquals(3 * $textSize + $imageSize, $cachedData['size']); $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']); - $this->assertEquals($mtime, $cachedData['mtime']); } } |