diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-22 00:43:43 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-22 00:43:43 -0500 |
commit | 465c100d8f5932340ea80f8a426ca7f404fc97c6 (patch) | |
tree | 321ad70b5e33d4d4a21eb3cf51c06dedfb06cdca /tests | |
parent | e666ce3622bed37ba6d9327aeecdf4a96dc7f5f4 (diff) | |
download | nextcloud-server-465c100d8f5932340ea80f8a426ca7f404fc97c6.tar.gz nextcloud-server-465c100d8f5932340ea80f8a426ca7f404fc97c6.zip |
Add tests for mtime changes in folders - testRename is failing right now
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/updater.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index cad3d9d46fc..8bf395698ae 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -78,9 +78,11 @@ class Updater extends \PHPUnit_Framework_TestCase { $cachedData = $this->cache->get('foo.txt'); $this->assertEquals(3, $cachedData['size']); $this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']); + $mtime = $cachedData['mtime']; $cachedData = $this->cache->get(''); $this->assertEquals(2 * $textSize + $imageSize + 3, $cachedData['size']); $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']); + $this->assertEquals($mtime, $rootCachedData['mtime']); $rootCachedData = $cachedData; $this->assertFalse($this->cache->inCache('bar.txt')); @@ -88,9 +90,11 @@ class Updater extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->cache->inCache('bar.txt')); $cachedData = $this->cache->get('bar.txt'); $this->assertEquals(3, $cachedData['size']); + $mtime = $cachedData['mtime']; $cachedData = $this->cache->get(''); $this->assertEquals(2 * $textSize + $imageSize + 2 * 3, $cachedData['size']); $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']); + $this->assertEquals($mtime, $rootCachedData['mtime']); } public function testDelete() { @@ -105,6 +109,7 @@ class Updater extends \PHPUnit_Framework_TestCase { $cachedData = $this->cache->get(''); $this->assertEquals(2 * $textSize + $imageSize, $cachedData['size']); $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']); + $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']); $rootCachedData = $cachedData; Filesystem::mkdir('bar_folder'); @@ -116,6 +121,7 @@ class Updater extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->cache->inCache('bar_folder')); $cachedData = $this->cache->get(''); $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']); + $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']); } public function testRename() { @@ -132,8 +138,10 @@ class Updater extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->cache->inCache('bar.txt')); $cachedData = $this->cache->get('foo.txt'); $this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']); + $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']); } } |