Fix failing unit test 💀

This commit is contained in:
Thomas Müller 2015-11-19 16:20:27 +01:00
parent 9ec2850c78
commit c565a7b042
2 changed files with 2 additions and 16 deletions

View File

@ -237,7 +237,7 @@ class OC_Util {
$newValue = json_encode($excludedGroups);
$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
}
$usersGroups = $groupManager->getUserGroups($user);
$usersGroups = $groupManager->getUserGroupIds($user);
if (!empty($usersGroups)) {
$remainingGroups = array_diff($usersGroups, $excludedGroups);
// if the user is only in groups which are disabled for sharing then

View File

@ -306,24 +306,10 @@ class Test_Util extends \Test\TestCase {
$groupManager
->expects($this->at(0))
->method('getUserGroups')
->method('getUserGroupIds')
->with($user)
->will($this->returnValue($membership));
// $uid = "user1";
// \OC_User::setUserId($uid);
//
// \OC_User::createUser($uid, "passwd");
//
// foreach ($groups as $group) {
// \OC_Group::createGroup($group);
// }
//
// foreach ($membership as $group) {
// \OC_Group::addToGroup($uid, $group);
// }
//
$result = \OC_Util::isSharingDisabledForUser($config, $groupManager, $user);
$this->assertSame($expected, $result);