Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/connector/sabre/principal.php')
-rw-r--r--apps/dav/tests/unit/connector/sabre/principal.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/dav/tests/unit/connector/sabre/principal.php b/apps/dav/tests/unit/connector/sabre/principal.php
index 07bfd5d263b..1747885240a 100644
--- a/apps/dav/tests/unit/connector/sabre/principal.php
+++ b/apps/dav/tests/unit/connector/sabre/principal.php
@@ -202,16 +202,26 @@ class Principal extends TestCase {
public function testGetGroupMembership() {
$fooUser = $this->getMockBuilder('\OC\User\User')
->disableOriginalConstructor()->getMock();
+ $group = $this->getMockBuilder('\OCP\IGroup')
+ ->disableOriginalConstructor()->getMock();
+ $group->expects($this->once())
+ ->method('getGID')
+ ->willReturn('group1');
$this->userManager
->expects($this->once())
->method('get')
->with('foo')
->willReturn($fooUser);
$this->groupManager
+ ->expects($this->once())
->method('getUserGroups')
- ->willReturn([]);
+ ->willReturn([
+ $group
+ ]);
- $expectedResponse = [];
+ $expectedResponse = [
+ 'principals/groups/group1'
+ ];
$response = $this->connector->getGroupMembership('principals/users/foo');
$this->assertSame($expectedResponse, $response);
}