mirror of
https://github.com/nextcloud/server.git
synced 2026-04-27 01:00:20 -04:00
Don't rely on the sorting the database gives us for tests
This commit is contained in:
parent
472d896ce9
commit
8d0e162daf
2 changed files with 12 additions and 5 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue