diff --git a/tests/lib/appconfig.php b/tests/lib/appconfig.php
index 5cbdf80502f428be646740da37736ef78204c65d..6ae790a9edd774102a40faf8e674823d8de607bc 100644
--- a/tests/lib/appconfig.php
+++ b/tests/lib/appconfig.php
@@ -42,6 +42,7 @@ class Test_Appconfig extends PHPUnit_Framework_TestCase {
 		while ($row = $result->fetchRow()) {
 			$expected[] = $row['appid'];
 		}
+		sort($expected);
 		$apps = \OC_Appconfig::getApps();
 		$this->assertEquals($expected, $apps);
 	}
@@ -53,6 +54,7 @@ class Test_Appconfig extends PHPUnit_Framework_TestCase {
 		while($row = $result->fetchRow()) {
 			$expected[] = $row["configkey"];
 		}
+		sort($expected);
 		$keys = \OC_Appconfig::getKeys('testapp');
 		$this->assertEquals($expected, $keys);
 	}