summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-10 10:43:32 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-10 10:43:32 +0100
commit2e94d34dfd99378bfaa39243a265a55a1b8038ba (patch)
tree4cef15e963fa2d89d9474460f4c928d0d75b3da3 /apps/dav/tests
parent29820176825c41acef30fa6942922aeb36cfcec3 (diff)
downloadnextcloud-server-2e94d34dfd99378bfaa39243a265a55a1b8038ba.tar.gz
nextcloud-server-2e94d34dfd99378bfaa39243a265a55a1b8038ba.zip
Fix group principal
Diffstat (limited to 'apps/dav/tests')
-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);
}