summaryrefslogtreecommitdiffstats
path: root/tests/lib/app.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-02 14:47:38 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-16 15:16:13 +0100
commit23ab25e93a62fcc4a41ec74db2b32741f98ab34a (patch)
treed8cca1da36ed7d757580dcafc1d71e6d190c5b43 /tests/lib/app.php
parent2b58e8489fcb5eff0e2312209beca038bfe9b40a (diff)
downloadnextcloud-server-23ab25e93a62fcc4a41ec74db2b32741f98ab34a.tar.gz
nextcloud-server-23ab25e93a62fcc4a41ec74db2b32741f98ab34a.zip
Use the app manager from oc_app
Diffstat (limited to 'tests/lib/app.php')
-rw-r--r--tests/lib/app.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/lib/app.php b/tests/lib/app.php
index 0c0eb28b3ba..c16bc0566fd 100644
--- a/tests/lib/app.php
+++ b/tests/lib/app.php
@@ -10,6 +10,7 @@
class Test_App extends \Test\TestCase {
private $oldAppConfigService;
+ private $oldAppManagerService;
const TEST_USER1 = 'user1';
const TEST_USER2 = 'user2';
@@ -491,18 +492,24 @@ class Test_App extends \Test\TestCase {
*/
private function registerAppConfig($appConfig) {
$this->oldAppConfigService = \OC::$server->query('AppConfig');
+ $this->oldAppManagerService = \OC::$server->query('AppManager');
\OC::$server->registerService('AppConfig', function ($c) use ($appConfig) {
return $appConfig;
});
+ \OC::$server->registerService('AppManager', function (\OC\Server $c) use ($appConfig) {
+ return new \OC\App\AppManager($c->getUserSession(), $appConfig, $c->getGroupManager());
+ });
}
/**
* Restore the original app config service.
*/
private function restoreAppConfig() {
- $oldService = $this->oldAppConfigService;
- \OC::$server->registerService('AppConfig', function ($c) use ($oldService){
- return $oldService;
+ \OC::$server->registerService('AppConfig', function ($c){
+ return $this->oldAppConfigService;
+ });
+ \OC::$server->registerService('AppManager', function ($c) {
+ return $this->oldAppManagerService;
});
// Remove the cache of the mocked apps list with a forceRefresh