summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-12-15 11:32:32 +0100
committerVincent Petry <pvince81@owncloud.com>2014-12-15 11:32:32 +0100
commit50072894228403db91ebd6bbd5e997e2cfa8c9f4 (patch)
tree5b89afc7d1caa568ccfb80839170cca308cf6102 /tests
parent036456fe16e258d1d5f803e9a99a10a45de542ba (diff)
downloadnextcloud-server-50072894228403db91ebd6bbd5e997e2cfa8c9f4.tar.gz
nextcloud-server-50072894228403db91ebd6bbd5e997e2cfa8c9f4.zip
Sort results to make sure assert work on consistent order
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/cache.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 1af8e4da960..81d7f3ce0bc 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -306,6 +306,8 @@ class Cache extends \Test\TestCase {
$this->assertEquals(2, count($results));
+ usort($results, function($value1, $value2) { return $value1['name'] >= $value2['name']; });
+
$this->assertEquals('folder', $results[0]['name']);
$this->assertEquals('foo', $results[1]['name']);
@@ -316,9 +318,11 @@ class Cache extends \Test\TestCase {
$results = $this->cache->searchByTag(current($tags)->getId(), $userId);
$this->assertEquals(3, count($results));
+ usort($results, function($value1, $value2) { return $value1['name'] >= $value2['name']; });
+
$this->assertEquals('folder', $results[0]['name']);
- $this->assertEquals('foobar', $results[1]['name']);
- $this->assertEquals('foo2', $results[2]['name']);
+ $this->assertEquals('foo2', $results[1]['name']);
+ $this->assertEquals('foobar', $results[2]['name']);
$tagManager->delete('tag1');
$tagManager->delete('tag2');