Add tests for mtime changes in folders - testRename is failing right now
This commit is contained in:
parent
e666ce3622
commit
465c100d8f
|
@ -78,9 +78,11 @@ class Updater extends \PHPUnit_Framework_TestCase {
|
||||||
$cachedData = $this->cache->get('foo.txt');
|
$cachedData = $this->cache->get('foo.txt');
|
||||||
$this->assertEquals(3, $cachedData['size']);
|
$this->assertEquals(3, $cachedData['size']);
|
||||||
$this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']);
|
||||||
|
$mtime = $cachedData['mtime'];
|
||||||
$cachedData = $this->cache->get('');
|
$cachedData = $this->cache->get('');
|
||||||
$this->assertEquals(2 * $textSize + $imageSize + 3, $cachedData['size']);
|
$this->assertEquals(2 * $textSize + $imageSize + 3, $cachedData['size']);
|
||||||
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
||||||
|
$this->assertEquals($mtime, $rootCachedData['mtime']);
|
||||||
$rootCachedData = $cachedData;
|
$rootCachedData = $cachedData;
|
||||||
|
|
||||||
$this->assertFalse($this->cache->inCache('bar.txt'));
|
$this->assertFalse($this->cache->inCache('bar.txt'));
|
||||||
|
@ -88,9 +90,11 @@ class Updater extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertTrue($this->cache->inCache('bar.txt'));
|
$this->assertTrue($this->cache->inCache('bar.txt'));
|
||||||
$cachedData = $this->cache->get('bar.txt');
|
$cachedData = $this->cache->get('bar.txt');
|
||||||
$this->assertEquals(3, $cachedData['size']);
|
$this->assertEquals(3, $cachedData['size']);
|
||||||
|
$mtime = $cachedData['mtime'];
|
||||||
$cachedData = $this->cache->get('');
|
$cachedData = $this->cache->get('');
|
||||||
$this->assertEquals(2 * $textSize + $imageSize + 2 * 3, $cachedData['size']);
|
$this->assertEquals(2 * $textSize + $imageSize + 2 * 3, $cachedData['size']);
|
||||||
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
||||||
|
$this->assertEquals($mtime, $rootCachedData['mtime']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDelete() {
|
public function testDelete() {
|
||||||
|
@ -105,6 +109,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
|
||||||
$cachedData = $this->cache->get('');
|
$cachedData = $this->cache->get('');
|
||||||
$this->assertEquals(2 * $textSize + $imageSize, $cachedData['size']);
|
$this->assertEquals(2 * $textSize + $imageSize, $cachedData['size']);
|
||||||
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
||||||
|
$this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
|
||||||
$rootCachedData = $cachedData;
|
$rootCachedData = $cachedData;
|
||||||
|
|
||||||
Filesystem::mkdir('bar_folder');
|
Filesystem::mkdir('bar_folder');
|
||||||
|
@ -116,6 +121,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertFalse($this->cache->inCache('bar_folder'));
|
$this->assertFalse($this->cache->inCache('bar_folder'));
|
||||||
$cachedData = $this->cache->get('');
|
$cachedData = $this->cache->get('');
|
||||||
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
||||||
|
$this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRename() {
|
public function testRename() {
|
||||||
|
@ -132,8 +138,10 @@ class Updater extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertTrue($this->cache->inCache('bar.txt'));
|
$this->assertTrue($this->cache->inCache('bar.txt'));
|
||||||
$cachedData = $this->cache->get('foo.txt');
|
$cachedData = $this->cache->get('foo.txt');
|
||||||
$this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($fooCachedData['etag'], $cachedData['etag']);
|
||||||
|
$mtime = $cachedData['mtime'];
|
||||||
$cachedData = $this->cache->get('');
|
$cachedData = $this->cache->get('');
|
||||||
$this->assertEquals(3 * $textSize + $imageSize, $cachedData['size']);
|
$this->assertEquals(3 * $textSize + $imageSize, $cachedData['size']);
|
||||||
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
$this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
|
||||||
|
$this->assertEquals($mtime, $cachedData['mtime']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue