From 3bcdad62fb18d08d18f6460e32ddd95021a958c9 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Wed, 4 Jun 2014 10:01:50 +0200
Subject: [PATCH] Fix unit tests

---
 tests/lib/files/cache/scanner.php |  8 --------
 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);
 
-- 
GitLab