diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-06-04 10:01:50 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-06-04 10:01:50 +0200 |
commit | 3bcdad62fb18d08d18f6460e32ddd95021a958c9 (patch) | |
tree | c4b26b94ed8115d2f5c7776b6bbb366f622df9b0 /tests | |
parent | a6bb1e1bf8bcea9c4ad4e13e73f397efcc6fc27b (diff) | |
download | nextcloud-server-3bcdad62fb18d08d18f6460e32ddd95021a958c9.tar.gz nextcloud-server-3bcdad62fb18d08d18f6460e32ddd95021a958c9.zip |
Fix unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/scanner.php | 8 | ||||
-rw-r--r-- | tests/lib/files/utils/scanner.php | 14 |
2 files changed, 10 insertions, 12 deletions
diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index fb06f2dff3d..56c7b65bb08 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -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']); } } diff --git a/tests/lib/files/utils/scanner.php b/tests/lib/files/utils/scanner.php index 267fc63302d..159a2a48677 100644 --- a/tests/lib/files/utils/scanner.php +++ b/tests/lib/files/utils/scanner.php @@ -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); |