summaryrefslogtreecommitdiffstats
path: root/settings/application.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-01-30 17:24:42 +0100
committerLukas Reschke <lukas@owncloud.com>2015-01-30 17:24:42 +0100
commit0f7634eadc2eee3a32116e2b2686ca462dfaaafa (patch)
treed22b3d8e9b6b83bc47c4b848a6e6823b7d9d86c6 /settings/application.php
parent7e7dd92f6b7c255ea7a94cbcf0e2e762ef49f8ee (diff)
downloadnextcloud-server-0f7634eadc2eee3a32116e2b2686ca462dfaaafa.tar.gz
nextcloud-server-0f7634eadc2eee3a32116e2b2686ca462dfaaafa.zip
Switch to a factory and add unit tests
Diffstat (limited to 'settings/application.php')
-rw-r--r--settings/application.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/settings/application.php b/settings/application.php
index 3b2c77ab849..6fe23447a72 100644
--- a/settings/application.php
+++ b/settings/application.php
@@ -16,6 +16,7 @@ use OC\Settings\Controller\LogSettingsController;
use OC\Settings\Controller\MailSettingsController;
use OC\Settings\Controller\SecuritySettingsController;
use OC\Settings\Controller\UsersController;
+use OC\Settings\Factory\SubAdminFactory;
use OC\Settings\Middleware\SubadminMiddleware;
use \OCP\AppFramework\App;
use OCP\IContainer;
@@ -92,7 +93,7 @@ class Application extends App {
$c->query('DefaultMailAddress'),
$c->query('URLGenerator'),
$c->query('OCP\\App\\IAppManager'),
- $c->query('SubAdminOfGroups')
+ $c->query('SubAdminFactory')
);
});
$container->registerService('LogSettingsController', function(IContainer $c) {
@@ -147,8 +148,8 @@ class Application extends App {
return \OC_Subadmin::isSubAdmin(\OC_User::getUser());
});
/** FIXME: Remove once OC_SubAdmin is non-static and mockable */
- $container->registerService('SubAdminOfGroups', function(IContainer $c) {
- return \OC_SubAdmin::getSubAdminsGroups(\OC_User::getUser());
+ $container->registerService('SubAdminFactory', function(IContainer $c) {
+ return new SubAdminFactory();
});
$container->registerService('Mail', function(IContainer $c) {
return new \OC_Mail;