summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CalDAV
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2019-08-01 18:37:50 +0200
committerGeorg Ehrke <developer@georgehrke.com>2019-08-01 19:40:27 +0200
commitab6add54c7d11d34230b2ce55f30e87f68b1c28d (patch)
tree2627de0f137a5a29b521781dc45ade360bd0cc45 /apps/dav/tests/unit/CalDAV
parentb246e58a1ed1e37401503ac0212d6b61bfe83cb7 (diff)
downloadnextcloud-server-ab6add54c7d11d34230b2ce55f30e87f68b1c28d.tar.gz
nextcloud-server-ab6add54c7d11d34230b2ce55f30e87f68b1c28d.zip
Allow to do a principal property search based on metadata keys
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/tests/unit/CalDAV')
-rw-r--r--apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
index eb9faa574a1..f4019d86e2b 100644
--- a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
@@ -219,6 +219,26 @@ abstract class AbstractPrincipalBackendTest extends TestCase {
];
}
+ public function testSearchPrincipalsByMetadataKey() {
+ $user = $this->createMock(IUser::class);
+ $this->userSession->expects($this->once())
+ ->method('getUser')
+ ->with()
+ ->will($this->returnValue($user));
+ $this->groupManager->expects($this->once())
+ ->method('getUserGroupIds')
+ ->with($user)
+ ->will($this->returnValue(['group1', 'group2']));
+
+ $actual = $this->principalBackend->searchPrincipals($this->principalPrefix, [
+ '{http://nextcloud.com/ns}meta3' => 'value',
+ ]);
+
+ $this->assertEquals([
+ $this->principalPrefix . '/backend2-res4',
+ ], $actual);
+ }
+
public function testSearchPrincipalsByCalendarUserAddressSet() {
$user = $this->createMock(IUser::class);
$this->userSession->method('getUser')