ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Schedule\PluginPropertiesTest Class Reference
+ Inheritance diagram for Sabre\CalDAV\Schedule\PluginPropertiesTest:
+ Collaboration diagram for Sabre\CalDAV\Schedule\PluginPropertiesTest:

Public Member Functions

 setUp ()
 
 testPrincipalProperties ()
 
 testPrincipalPropertiesBadPrincipal ()
 
 testNoDefaultCalendar ()
 
 testAvailabilityMapping ()
 There are two properties for availability. More...
 
- Public Member Functions inherited from Sabre\DAVServerTest
 setUp ()
 
 initializeEverything ()
 
 request ($request, $expectedStatus=null)
 Makes a request, and returns a response object. More...
 
 autoLogin ($userName)
 This function takes a username and sets the server in a state where this user is logged in, and no longer requires an authentication check. More...
 
 setUpTree ()
 Override this to provide your own Tree for your test-case. More...
 
 setUpBackends ()
 
 assertHttpStatus ($expectedStatus, HTTP\Request $req)
 

Protected Attributes

 $setupCalDAV = true
 
 $setupCalDAVScheduling = true
 
 $setupPropertyStorage = true
 
- Protected Attributes inherited from Sabre\DAVServerTest
 $setupCalDAV = false
 
 $setupCardDAV = false
 
 $setupACL = false
 
 $setupCalDAVSharing = false
 
 $setupCalDAVScheduling = false
 
 $setupCalDAVSubscriptions = false
 
 $setupCalDAVICSExport = false
 
 $setupLocks = false
 
 $setupFiles = false
 
 $setupSharing = false
 
 $setupPropertyStorage = false
 
 $caldavCalendars = []
 An array with calendars. More...
 
 $caldavCalendarObjects = []
 
 $carddavAddressBooks = []
 
 $carddavCards = []
 
 $server
 
 $tree = []
 
 $caldavBackend
 
 $carddavBackend
 
 $principalBackend
 
 $locksBackend
 
 $propertyStorageBackend
 
 $caldavPlugin
 
 $carddavPlugin
 
 $aclPlugin
 
 $caldavSharingPlugin
 
 $caldavSchedulePlugin
 
 $authPlugin
 
 $locksPlugin
 
 $sharingPlugin
 
 $propertyStoragePlugin
 
 $autoLogin = null
 If this string is set, we will automatically log in the user with this name. More...
 

Detailed Description

Definition at line 7 of file PluginPropertiesTest.php.

Member Function Documentation

◆ setUp()

Sabre\CalDAV\Schedule\PluginPropertiesTest::setUp ( )

Reimplemented from Sabre\DAVServerTest.

Definition at line 13 of file PluginPropertiesTest.php.

13 {
14
15 parent::setUp();
16 $this->caldavBackend->createCalendar(
17 'principals/user1',
18 'default',
19 [
20
21 ]
22 );
23 $this->principalBackend->addPrincipal([
24 'uri' => 'principals/user1/calendar-proxy-read'
25 ]);
26
27 }

◆ testAvailabilityMapping()

Sabre\CalDAV\Schedule\PluginPropertiesTest::testAvailabilityMapping ( )

There are two properties for availability.

The server should automatically map the old property to the standard property.

Definition at line 114 of file PluginPropertiesTest.php.

114 {
115
116 $path = 'calendars/user1/inbox';
117 $oldProp = '{http://calendarserver.org/ns/}calendar-availability';
118 $newProp = '{urn:ietf:params:xml:ns:caldav}calendar-availability';
119 $value1 = 'first value';
120 $value2 = 'second value';
121
122 // Storing with the old name
123 $this->server->updateProperties($path, [
124 $oldProp => $value1
125 ]);
126
127 // Retrieving with the new name
128 $this->assertEquals(
129 [$newProp => $value1],
130 $this->server->getProperties($path, [$newProp])
131 );
132
133 // Storing with the new name
134 $this->server->updateProperties($path, [
135 $newProp => $value2
136 ]);
137
138 // Retrieving with the old name
139 $this->assertEquals(
140 [$oldProp => $value2],
141 $this->server->getProperties($path, [$oldProp])
142 );
143
144 }
$path
Definition: aliased.php:25

References $path.

◆ testNoDefaultCalendar()

Sabre\CalDAV\Schedule\PluginPropertiesTest::testNoDefaultCalendar ( )

Definition at line 94 of file PluginPropertiesTest.php.

94 {
95
96 foreach ($this->caldavBackend->getCalendarsForUser('principals/user1') as $calendar) {
97 $this->caldavBackend->deleteCalendar($calendar['id']);
98 }
99 $props = $this->server->getPropertiesForPath('/principals/user1', [
100 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
101 ]);
102
103 $this->assertArrayHasKey(0, $props);
104 $this->assertArrayHasKey(404, $props[0]);
105
106 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][404]);
107
108 }

References $calendar.

◆ testPrincipalProperties()

Sabre\CalDAV\Schedule\PluginPropertiesTest::testPrincipalProperties ( )

Definition at line 29 of file PluginPropertiesTest.php.

29 {
30
31 $props = $this->server->getPropertiesForPath('/principals/user1', [
32 '{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL',
33 '{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL',
34 '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set',
35 '{urn:ietf:params:xml:ns:caldav}calendar-user-type',
36 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
37 ]);
38
39 $this->assertArrayHasKey(0, $props);
40 $this->assertArrayHasKey(200, $props[0]);
41
42 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL', $props[0][200]);
43 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL'];
44 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
45 $this->assertEquals('calendars/user1/outbox/', $prop->getHref());
46
47 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL', $props[0][200]);
48 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL'];
49 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
50 $this->assertEquals('calendars/user1/inbox/', $prop->getHref());
51
52 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}calendar-user-address-set', $props[0][200]);
53 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-user-address-set'];
54 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
55 $this->assertEquals(['mailto:user1.sabredav@sabredav.org', '/principals/user1/'], $prop->getHrefs());
56
57 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}calendar-user-type', $props[0][200]);
58 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-user-type'];
59 $this->assertEquals('INDIVIDUAL', $prop);
60
61 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][200]);
62 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL'];
63 $this->assertEquals('calendars/user1/default/', $prop->getHref());
64
65 }

◆ testPrincipalPropertiesBadPrincipal()

Sabre\CalDAV\Schedule\PluginPropertiesTest::testPrincipalPropertiesBadPrincipal ( )

Definition at line 66 of file PluginPropertiesTest.php.

66 {
67
68 $props = $this->server->getPropertiesForPath('principals/user1/calendar-proxy-read', [
69 '{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL',
70 '{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL',
71 '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set',
72 '{urn:ietf:params:xml:ns:caldav}calendar-user-type',
73 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
74 ]);
75
76 $this->assertArrayHasKey(0, $props);
77 $this->assertArrayHasKey(200, $props[0]);
78 $this->assertArrayHasKey(404, $props[0]);
79
80 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL', $props[0][404]);
81 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL', $props[0][404]);
82
83 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-user-address-set'];
84 $this->assertTrue($prop instanceof DAV\Xml\Property\Href);
85 $this->assertEquals(['/principals/user1/calendar-proxy-read/'], $prop->getHrefs());
86
87 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}calendar-user-type', $props[0][200]);
88 $prop = $props[0][200]['{urn:ietf:params:xml:ns:caldav}calendar-user-type'];
89 $this->assertEquals('INDIVIDUAL', $prop);
90
91 $this->assertArrayHasKey('{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][404]);
92
93 }

Field Documentation

◆ $setupCalDAV

Sabre\CalDAV\Schedule\PluginPropertiesTest::$setupCalDAV = true
protected

Definition at line 9 of file PluginPropertiesTest.php.

◆ $setupCalDAVScheduling

Sabre\CalDAV\Schedule\PluginPropertiesTest::$setupCalDAVScheduling = true
protected

Definition at line 10 of file PluginPropertiesTest.php.

◆ $setupPropertyStorage

Sabre\CalDAV\Schedule\PluginPropertiesTest::$setupPropertyStorage = true
protected

Definition at line 11 of file PluginPropertiesTest.php.


The documentation for this class was generated from the following file: