Merge pull request #20546 from owncloud/provision_api_fix

[provisioning api] Return empty list if group does not have subadmins
This commit is contained in:
Thomas Müller 2015-11-18 09:13:13 +01:00
commit 11f123c7d8
2 changed files with 3 additions and 10 deletions

View file

@ -176,14 +176,8 @@ class Groups{
foreach ($subadmins as $user) {
$uids[] = $user->getUID();
}
$subadmins = $uids;
// Go
if(!$subadmins) {
return new OC_OCS_Result(null, 102, 'Unknown error occured');
} else {
return new OC_OCS_Result($subadmins);
}
return new OC_OCS_Result($uids);
}
}

View file

@ -308,9 +308,8 @@ class GroupsTest extends \Test\TestCase {
]);
$this->assertInstanceOf('OC_OCS_Result', $result);
$this->assertFalse($result->succeeded());
$this->assertEquals(102, $result->getStatusCode());
$this->assertEquals('Unknown error occured', $result->getMeta()['message']);
$this->assertTrue($result->succeeded());
$this->assertEquals([], $result->getData());
}
public function testAddGroupEmptyGroup() {