aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-12-15 13:23:59 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-15 13:23:59 +0100
commiteb97bb5617199f0ea0e80181767d6713cef32395 (patch)
treebf741b6459aaab6646ce914f2032dd0cbf792ba2 /tests
parentbe45366013c50d9a9d18e258c66e18798719d8df (diff)
parent50072894228403db91ebd6bbd5e997e2cfa8c9f4 (diff)
downloadnextcloud-server-eb97bb5617199f0ea0e80181767d6713cef32395.tar.gz
nextcloud-server-eb97bb5617199f0ea0e80181767d6713cef32395.zip
Merge pull request #12846 from owncloud/fix-searchbytags-test
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');