diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-03 01:24:27 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-09 17:35:09 -0600 |
commit | a5ba1f78033b3ebe69c771fb33c1217a60494728 (patch) | |
tree | b4bdf0ec562db9e91071eeef39f82586ce48eef4 /apps/federatedfilesharing | |
parent | 6fd0e7e93995facfe75b26699ea462bb94fd03b9 (diff) | |
download | nextcloud-server-a5ba1f78033b3ebe69c771fb33c1217a60494728.tar.gz nextcloud-server-a5ba1f78033b3ebe69c771fb33c1217a60494728.zip |
Remove legacy class OC_Group and OC_User
* basically a straight replacement of the wrapped code at the calling code parts
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r-- | apps/federatedfilesharing/tests/TestCase.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/federatedfilesharing/tests/TestCase.php b/apps/federatedfilesharing/tests/TestCase.php index 7ccf76bbbc6..b31772e4e9e 100644 --- a/apps/federatedfilesharing/tests/TestCase.php +++ b/apps/federatedfilesharing/tests/TestCase.php @@ -42,7 +42,7 @@ abstract class TestCase extends \Test\TestCase { // reset backend \OC_User::clearBackends(); - \OC_Group::clearBackends(); + \OC::$server->getGroupManager()->clearBackends(); // create users $backend = new \Test\Util\User\Dummy(); @@ -76,8 +76,8 @@ abstract class TestCase extends \Test\TestCase { // reset backend \OC_User::clearBackends(); \OC_User::useBackend('database'); - \OC_Group::clearBackends(); - \OC_Group::useBackend(new Database()); + \OC::$server->getGroupManager()->clearBackends(); + \OC::$server->getGroupManager()->addBackend(new Database()); parent::tearDownAfterClass(); } @@ -94,9 +94,15 @@ abstract class TestCase extends \Test\TestCase { } if ($create) { - \OC::$server->getUserManager()->createUser($user, $password); - \OC_Group::createGroup('group'); - \OC_Group::addToGroup($user, 'group'); + $userManager = \OC::$server->getUserManager(); + $groupManager = \OC::$server->getGroupManager(); + + $userObject = $userManager->createUser($user, $password); + $group = $groupManager->createGroup('group'); + + if ($group and $userObject) { + $group->addUser($userObject); + } } self::resetStorage(); |