Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase { ...@@ -44,7 +44,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$expected[] = $row['userid']; $expected[] = $row['userid'];
} }
$this->assertEquals($expected, \OC_Preferences::getUsers()); sort($expected);
$users = \OC_Preferences::getUsers();
sort($users);
$this->assertEquals($expected, $users);
} }
public function testGetApps() { public function testGetApps() {
...@@ -55,8 +58,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase { ...@@ -55,8 +58,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$expected[] = $row['appid']; $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() { public function testGetKeys() {
$query = \OC_DB::prepare('SELECT DISTINCT `configkey` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ?'); $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 { ...@@ -66,7 +71,10 @@ class Test_Preferences extends PHPUnit_Framework_TestCase {
$expected[] = $row['configkey']; $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() { public function testGetValue() {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* later. * later.
* See the COPYING-README file. * See the COPYING-README file.
*/ */
class Test_Preferences_Object extends PHPUnit_Framework_TestCase { class Test_Preferences_Object extends PHPUnit_Framework_TestCase {
public function testGetUsers() public function testGetUsers()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment