From ab6add54c7d11d34230b2ce55f30e87f68b1c28d Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 1 Aug 2019 18:37:50 +0200 Subject: Allow to do a principal property search based on metadata keys Signed-off-by: Georg Ehrke --- .../ResourceBooking/AbstractPrincipalBackendTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apps/dav/tests/unit/CalDAV') 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') -- cgit v1.2.3