diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2015-11-16 22:24:53 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2015-11-16 22:24:53 +0100 |
commit | 6dcaac7e2c68ed55c59e4aa40e9cca3a79712f84 (patch) | |
tree | 7f9ce7d74b485a288a51cf44c05e029cfadd8872 /apps | |
parent | 5ec64c4fd7f087027ef945c4d694de1d90bbd814 (diff) | |
download | nextcloud-server-6dcaac7e2c68ed55c59e4aa40e9cca3a79712f84.tar.gz nextcloud-server-6dcaac7e2c68ed55c59e4aa40e9cca3a79712f84.zip |
Return empty list if group does not have subadmins
Instead of throwing an error just return an empty list. Since that is
actually what it is.
Fixes #19789
Diffstat (limited to 'apps')
-rw-r--r-- | apps/provisioning_api/lib/groups.php | 8 | ||||
-rw-r--r-- | apps/provisioning_api/tests/groupstest.php | 5 |
2 files changed, 3 insertions, 10 deletions
diff --git a/apps/provisioning_api/lib/groups.php b/apps/provisioning_api/lib/groups.php index 7c35caca5fd..7a6e6150782 100644 --- a/apps/provisioning_api/lib/groups.php +++ b/apps/provisioning_api/lib/groups.php @@ -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); } } diff --git a/apps/provisioning_api/tests/groupstest.php b/apps/provisioning_api/tests/groupstest.php index 7d4beb6a368..d37f4412e20 100644 --- a/apps/provisioning_api/tests/groupstest.php +++ b/apps/provisioning_api/tests/groupstest.php @@ -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() { |