diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-02-02 14:47:38 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-02-16 15:16:13 +0100 |
commit | 23ab25e93a62fcc4a41ec74db2b32741f98ab34a (patch) | |
tree | d8cca1da36ed7d757580dcafc1d71e6d190c5b43 /tests/lib/app.php | |
parent | 2b58e8489fcb5eff0e2312209beca038bfe9b40a (diff) | |
download | nextcloud-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.php | 13 |
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 |