summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-06 10:24:28 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-08-05 16:53:28 +0200
commit8d0e162dafb9ab19e726d2d4fa9c5cdb621f806d (patch)
treec944996582a57fb7fdbd5fb59a3192604af7c706 /tests
parent472d896ce9aad4d526126a7aefa96127920585e6 (diff)
downloadnextcloud-server-8d0e162dafb9ab19e726d2d4fa9c5cdb621f806d.tar.gz
nextcloud-server-8d0e162dafb9ab19e726d2d4fa9c5cdb621f806d.zip
Don't rely on the sorting the database gives us for tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/preferences-singleton.php16
-rw-r--r--tests/lib/preferences.php1
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/lib/preferences-singleton.php b/tests/lib/preferences-singleton.php
index 17fe54ad1f5..2fde089263c 100644
--- a/tests/lib/preferences-singleton.php
+++ b/tests/lib/preferences-singleton.php
@@ -44,7 +44,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$expected[] = $row['userid'];
}
- $this->assertEquals($expected, \OC_Preferences::getUsers());
+ sort($expected);
+ $users = \OC_Preferences::getUsers();
+ sort($users);
+ $this->assertEquals($expected, $users);
}
public function testGetApps() {
@@ -55,8 +58,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$expected[] = $row['appid'];
}
- $this->assertEquals($expected, \OC_Preferences::getApps('Someuser'));
- }
+ sort($expected);
+ $apps = \OC_Preferences::getApps('Someuser');
+ sort($apps);
+ $this->assertEquals($expected, $apps); }
public function testGetKeys() {
$query = \OC_DB::prepare('SELECT DISTINCT `configkey` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ?');
@@ -66,7 +71,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$expected[] = $row['configkey'];
}
- $this->assertEquals($expected, \OC_Preferences::getKeys('Someuser', 'getkeysapp'));
+ sort($expected);
+ $keys = \OC_Preferences::getKeys('Someuser', 'getkeysapp');
+ sort($keys);
+ $this->assertEquals($expected, $keys);
}
public function testGetValue() {
diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php
index fe8e3e8b48c..f2117ecb716 100644
--- a/tests/lib/preferences.php
+++ b/tests/lib/preferences.php
@@ -6,7 +6,6 @@
* later.
* See the COPYING-README file.
*/
-
class Test_Preferences_Object extends PHPUnit_Framework_TestCase {
public function testGetUsers()
{