Even single shares are returned as array

When fetching a single share using ../shares/<ID> we should still return
an array of shares.

Fixes #22189
This commit is contained in:
Roeland Jago Douma 2016-02-08 10:11:22 +01:00
parent 4130639a7e
commit ca32778975
2 changed files with 2 additions and 2 deletions

View File

@ -170,7 +170,7 @@ class Share20OCS {
if ($this->canAccessShare($share)) {
$share = $this->formatShare($share);
return new \OC_OCS_Result($share);
return new \OC_OCS_Result([$share]);
} else {
return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
}

View File

@ -387,7 +387,7 @@ class Share20OCSTest extends \Test\TestCase {
['group', $group],
]));
$expected = new \OC_OCS_Result($result);
$expected = new \OC_OCS_Result([$result]);
$this->assertEquals($expected->getData(), $ocs->getShare($share->getId())->getData());
}