diff options
Diffstat (limited to 'apps/federatedfilesharing/tests/TestCase.php')
-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(); |