summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-10 14:22:18 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-10 14:22:18 +0100
commitc1d21cf873f14361a30b3473ebd8c8130b0656a5 (patch)
tree43097e82c6e722629f470679fc180255f3f4183e /apps/dav/tests
parent63b99b614c53c903148f4a7ff0c02ca625aa9890 (diff)
parent2e94d34dfd99378bfaa39243a265a55a1b8038ba (diff)
downloadnextcloud-server-c1d21cf873f14361a30b3473ebd8c8130b0656a5.tar.gz
nextcloud-server-c1d21cf873f14361a30b3473ebd8c8130b0656a5.zip
Merge pull request #22263 from owncloud/fix-group-principals
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);
}