Skip to content

Commit f402d5b

Browse files
fixup! fix: aliases and capitalization of emails
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent fe493a8 commit f402d5b

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

apps/dav/tests/unit/CalDAV/CalendarImplTest.php

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use OCA\DAV\CalDAV\Calendar;
1313
use OCA\DAV\CalDAV\CalendarImpl;
1414
use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer;
15-
use OCA\DAV\CalDAV\Schedule\Plugin;
1615
use OCA\DAV\Connector\Sabre\Server;
1716
use OCP\Calendar\Exceptions\CalendarException;
1817
use PHPUnit\Framework\MockObject\MockObject;
@@ -199,11 +198,15 @@ public function testHandleImipNoAttendee(): void {
199198
}
200199

201200
public function testHandleImipRequest(): void {
202-
203-
$userAddressess = [
204-
'mailto:attendee1@testing.com',
205-
'/remote.php/dav/principals/users/attendee1/',
206-
];
201+
$userAddressSet = new class([ 'mailto:attendee1@testing.com', '/remote.php/dav/principals/users/attendee1/', ]) {
202+
public function __construct(
203+
private array $hrefs
204+
) {
205+
}
206+
public function getHrefs(): array {
207+
return $this->hrefs;
208+
}
209+
};
207210

208211
$vObject = $this->vCalendar1a;
209212
$vObject->add('METHOD', 'REQUEST');
@@ -224,20 +227,27 @@ public function testHandleImipRequest(): void {
224227
->with($this->calendar->getPrincipalURI());
225228
/** @var \Sabre\DAVACL\Plugin|MockObject $aclPlugin */
226229
$aclPlugin = $this->createMock(\Sabre\DAVACL\Plugin::class);
227-
/** @var \OCA\DAV\CalDAV\Schedule\Plugin|MockObject $schedulingPlugin */
228-
$schedulingPlugin = $this->createMock(Plugin::class);
229-
$schedulingPlugin->expects(self::once())
230-
->method('getAddressesForPrincipal')
231-
->with($this->calendar->getPrincipalURI())
232-
->willReturn($userAddressess);
233230

234231
$server = $this->createMock(Server::class);
235232
$server->expects($this->any())
236233
->method('getPlugin')
237234
->willReturnMap([
238235
['auth', $authPlugin],
239236
['acl', $aclPlugin],
240-
['caldav-schedule', $schedulingPlugin]
237+
]);
238+
239+
$server->expects(self::once())
240+
->method('getProperties')
241+
->with(
242+
$this->calendar->getPrincipalURI(),
243+
[
244+
'{http://sabredav.org/ns}email-address',
245+
'{urn:ietf:params:xml:ns:caldav}calendar-user-address-set'
246+
]
247+
)
248+
->willReturn([
249+
'{http://sabredav.org/ns}email-address' => 'attendee1@testing.com',
250+
'{urn:ietf:params:xml:ns:caldav}calendar-user-address-set' => $userAddressSet,
241251
]);
242252
$server->expects(self::once())
243253
->method('emit');

0 commit comments

Comments
 (0)