// query for shared calendars
$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
+ $principals = array_map(function($principal) {
+ return urldecode($principal);
+ }, $principals);
$principals[]= $principalUri;
$fields = array_values($this->propertyMap);
// query for shared calendars
$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
+ $principals = array_map(function($principal) {
+ return urldecode($principal);
+ }, $principals);
$principals[]= $principalUri;
$query = $this->db->getQueryBuilder();
if (is_null($this->backend)) {
return;
}
+ $this->principal->expects($this->any())->method('getGroupMembership')
+ ->withAnyParameters()
+ ->willReturn([self::UNIT_TEST_GROUP, self::UNIT_TEST_GROUP2]);
$calendars = $this->backend->getCalendarsForUser(self::UNIT_TEST_USER);
foreach ($calendars as $calendar) {
$this->dispatcher->expects($this->at(0))
$this->random = \OC::$server->getSecureRandom();
$dispatcher = $this->createMock(EventDispatcherInterface::class);
+ $this->principal->expects($this->any())->method('getGroupMembership')
+ ->withAnyParameters()
+ ->willReturn([]);
+
$this->backend = new CalDavBackend(
$db,
$this->principal,
if (is_null($this->backend)) {
return;
}
+ $this->principal->expects($this->any())->method('getGroupMembership')
+ ->withAnyParameters()
+ ->willReturn([]);
$books = $this->backend->getCalendarsForUser(self::UNIT_TEST_USER);
foreach ($books as $book) {
$this->backend->deleteCalendar($book['id']);
if (is_null($this->backend)) {
return;
}
+
+ $this->principal->method('getGroupMembership')
+ ->withAnyParameters()
+ ->willReturn([self::UNIT_TEST_GROUP]);
$books = $this->backend->getAddressBooksForUser(self::UNIT_TEST_USER);
foreach ($books as $book) {
$this->backend->deleteAddressBook($book['id']);