ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PluginPropertiesWithSharedCalendarTest.php
Go to the documentation of this file.
1<?php
2
4
5use Sabre\DAV;
6
8
9 protected $setupCalDAV = true;
10 protected $setupCalDAVScheduling = true;
11 protected $setupCalDAVSharing = true;
12
13 function setUp() {
14
15 parent::setUp();
16 $this->caldavBackend->createCalendar(
17 'principals/user1',
18 'shared',
19 [
20 'share-access' => DAV\Sharing\Plugin::ACCESS_READWRITE
21 ]
22 );
23 $this->caldavBackend->createCalendar(
24 'principals/user1',
25 'default',
26 [
27
28 ]
29 );
30
31 }
32
34
35 $props = $this->server->getPropertiesForPath('/principals/user1', [
36 '{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL',
37 '{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL',
38 '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set',
39 '{urn:ietf:params:xml:ns:caldav}calendar-user-type',
40 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
41 ]);
42
43 $this->assertArrayHasKey(0, $props);
44 $this->assertArrayHasKey(200, $props[0]);
45
46 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL', $props[0][200]);
47 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL'];
48 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
49 $this->assertEquals('calendars/user1/outbox/', $prop->getHref());
50
51 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL', $props[0][200]);
52 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL'];
53 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
54 $this->assertEquals('calendars/user1/inbox/', $prop->getHref());
55
56 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}calendar-user-address-set', $props[0][200]);
57 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-user-address-set'];
58 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
59 $this->assertEquals(['mailto:user1.sabredav@sabredav.org', '/principals/user1/'], $prop->getHrefs());
60
61 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}calendar-user-type', $props[0][200]);
62 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-user-type'];
63 $this->assertEquals('INDIVIDUAL', $prop);
64
65 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][200]);
66 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL'];
67 $this->assertEquals('calendars/user1/default/', $prop->getHref());
68
69 }
70
71}
An exception for terminatinating execution or to throw for unit testing.
This class may be used as a basis for other webdav-related unittests.
Href property.
Definition: Href.php:26