Commit 8d0e162d authored by Robin Appelman's avatar Robin Appelman Committed by Morris Jobke
Browse files

Don't rely on the sorting the database gives us for tests

parent 472d896c
......@@ -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() {
......
......@@ -6,7 +6,6 @@
* later.
* See the COPYING-README file.
*/
class Test_Preferences_Object extends PHPUnit_Framework_TestCase {
public function testGetUsers()
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment