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:
commit
11f123c7d8
2 changed files with 3 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue