Fix unit tests

This commit is contained in:
Robin Appelman 2014-06-04 10:01:50 +02:00
parent a6bb1e1bf8
commit 3bcdad62fb
2 changed files with 10 additions and 12 deletions

View File

@ -234,13 +234,5 @@ class Scanner extends \PHPUnit_Framework_TestCase {
$newData0 = $this->cache->get('folder/bar.txt');
$this->assertInternalType('string', $newData0['etag']);
$this->assertNotEmpty($newData0['etag']);
$newData1 = $this->cache->get('folder');
$this->assertInternalType('string', $newData1['etag']);
$this->assertNotSame($data1['etag'], $newData1['etag']);
$newData2 = $this->cache->get('');
$this->assertInternalType('string', $newData2['etag']);
$this->assertNotSame($data2['etag'], $newData2['etag']);
}
}

View File

@ -105,8 +105,12 @@ class Scanner extends \PHPUnit_Framework_TestCase {
$scanner->scan('');
$this->assertEquals(array('/foo', '/foo/foo.txt', '/foo/folder', '/foo/folder/bar.txt'), $propagator->getChanges());
$this->assertEquals(array('/', '/foo', '/foo/folder'), $propagator->getAllParents());
$changes = $propagator->getChanges();
$parents = $propagator->getAllParents();
sort($changes);
sort($parents);
$this->assertEquals(array('/foo', '/foo/folder', '/foo/folder/bar.txt', '/foo/foo.txt'), $changes);
$this->assertEquals(array('/', '/foo', '/foo/folder'), $parents);
$cache->put('foo.txt', array('mtime' => time() - 50));
@ -116,8 +120,10 @@ class Scanner extends \PHPUnit_Framework_TestCase {
$scanner->scan('');
$this->assertEquals(array('/foo/foo.txt'), $propagator->getChanges());
$this->assertEquals(array('/', '/foo'), $propagator->getAllParents());
$changes = $propagator->getChanges();
$parents = $propagator->getAllParents();
$this->assertEquals(array('/foo/foo.txt'), $changes);
$this->assertEquals(array('/', '/foo'), $parents);
$scanner->setPropagator($originalPropagator);