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

Public Member Functions

 testMKCOL ()
 OS X 10.7 - 10.9.1. More...
 
 testMKCALENDAR ()
 OS X 10.9.2 and up. More...
 
 assertSubscription ($subscription)
 
- 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
 
 $setupCalDAVSubscriptions = 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 8 of file CreateSubscriptionTest.php.

Member Function Documentation

◆ assertSubscription()

Sabre\CalDAV\Subscriptions\CreateSubscriptionTest::assertSubscription (   $subscription)

Definition at line 106 of file CreateSubscriptionTest.php.

Referenced by Sabre\CalDAV\Subscriptions\CreateSubscriptionTest\testMKCALENDAR(), and Sabre\CalDAV\Subscriptions\CreateSubscriptionTest\testMKCOL().

106  {
107 
108  $this->assertEquals('', $subscription['{http://calendarserver.org/ns/}subscribed-strip-attachments']);
109  $this->assertEquals('', $subscription['{http://calendarserver.org/ns/}subscribed-strip-todos']);
110  $this->assertEquals('#1C4587FF', $subscription['{http://apple.com/ns/ical/}calendar-color']);
111  $this->assertEquals('Jewish holidays', $subscription['{DAV:}displayname']);
112  $this->assertEquals('Foo', $subscription['{urn:ietf:params:xml:ns:caldav}calendar-description']);
113  $this->assertEquals('19', $subscription['{http://apple.com/ns/ical/}calendar-order']);
114  $this->assertEquals('webcal://www.example.org/', $subscription['{http://calendarserver.org/ns/}source']->getHref());
115  $this->assertEquals('P1W', $subscription['{http://apple.com/ns/ical/}refreshrate']);
116  $this->assertEquals('subscription1', $subscription['uri']);
117  $this->assertEquals('principals/user1', $subscription['principaluri']);
118  $this->assertEquals('webcal://www.example.org/', $subscription['source']);
119  $this->assertEquals(['principals/user1', 1], $subscription['id']);
120 
121  }
+ Here is the caller graph for this function:

◆ testMKCALENDAR()

Sabre\CalDAV\Subscriptions\CreateSubscriptionTest::testMKCALENDAR ( )

OS X 10.9.2 and up.

Definition at line 57 of file CreateSubscriptionTest.php.

References $request, $response, Sabre\CalDAV\Subscriptions\CreateSubscriptionTest\assertSubscription(), color, and Sabre\DAVServerTest\request().

57  {
58 
59  $body = <<<XML
60 <B:mkcalendar xmlns:B="urn:ietf:params:xml:ns:caldav">
61  <A:set xmlns:A="DAV:">
62  <A:prop>
63  <B:supported-calendar-component-set>
64  <B:comp name="VEVENT" />
65  </B:supported-calendar-component-set>
66  <C:subscribed-strip-alarms xmlns:C="http://calendarserver.org/ns/" />
67  <C:subscribed-strip-attachments xmlns:C="http://calendarserver.org/ns/" />
68  <A:resourcetype>
69  <A:collection />
70  <C:subscribed xmlns:C="http://calendarserver.org/ns/" />
71  </A:resourcetype>
72  <D:refreshrate xmlns:D="http://apple.com/ns/ical/">P1W</D:refreshrate>
73  <C:source xmlns:C="http://calendarserver.org/ns/">
74  <A:href>webcal://www.example.org/</A:href>
75  </C:source>
76  <D:calendar-color xmlns:D="http://apple.com/ns/ical/">#1C4587FF</D:calendar-color>
77  <D:calendar-order xmlns:D="http://apple.com/ns/ical/">19</D:calendar-order>
78  <B:calendar-description>Foo</B:calendar-description>
79  <C:subscribed-strip-todos xmlns:C="http://calendarserver.org/ns/" />
80  <A:displayname>Jewish holidays</A:displayname>
81  </A:prop>
82  </A:set>
83 </B:mkcalendar>
84 XML;
85 
86  $headers = [
87  'Content-Type' => 'application/xml',
88  ];
89  $request = new Request('MKCALENDAR', '/calendars/user1/subscription1', $headers, $body);
90 
91  $response = $this->request($request);
92  $this->assertEquals(201, $response->getStatus());
93  $subscriptions = $this->caldavBackend->getSubscriptionsForUser('principals/user1');
94  $this->assertSubscription($subscriptions[0]);
95 
96  // Also seeing if it works when calling this as a PROPFIND.
97  $this->assertEquals([
98  '{http://calendarserver.org/ns/}subscribed-strip-alarms' => '',
99  ],
100  $this->server->getProperties('calendars/user1/subscription1', ['{http://calendarserver.org/ns/}subscribed-strip-alarms'])
101  );
102 
103 
104  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
if(PHP_SAPI !='cli') color
Definition: langcheck.php:120
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response
+ Here is the call graph for this function:

◆ testMKCOL()

Sabre\CalDAV\Subscriptions\CreateSubscriptionTest::testMKCOL ( )

OS X 10.7 - 10.9.1.

Definition at line 16 of file CreateSubscriptionTest.php.

References $request, $response, Sabre\CalDAV\Subscriptions\CreateSubscriptionTest\assertSubscription(), color, and Sabre\DAVServerTest\request().

16  {
17 
18  $body = <<<XML
19 <A:mkcol xmlns:A="DAV:">
20  <A:set>
21  <A:prop>
22  <B:subscribed-strip-attachments xmlns:B="http://calendarserver.org/ns/" />
23  <B:subscribed-strip-todos xmlns:B="http://calendarserver.org/ns/" />
24  <A:resourcetype>
25  <A:collection />
26  <B:subscribed xmlns:B="http://calendarserver.org/ns/" />
27  </A:resourcetype>
28  <E:calendar-color xmlns:E="http://apple.com/ns/ical/">#1C4587FF</E:calendar-color>
29  <A:displayname>Jewish holidays</A:displayname>
30  <C:calendar-description xmlns:C="urn:ietf:params:xml:ns:caldav">Foo</C:calendar-description>
31  <E:calendar-order xmlns:E="http://apple.com/ns/ical/">19</E:calendar-order>
32  <B:source xmlns:B="http://calendarserver.org/ns/">
33  <A:href>webcal://www.example.org/</A:href>
34  </B:source>
35  <E:refreshrate xmlns:E="http://apple.com/ns/ical/">P1W</E:refreshrate>
36  <B:subscribed-strip-alarms xmlns:B="http://calendarserver.org/ns/" />
37  </A:prop>
38  </A:set>
39 </A:mkcol>
40 XML;
41 
42  $headers = [
43  'Content-Type' => 'application/xml',
44  ];
45  $request = new Request('MKCOL', '/calendars/user1/subscription1', $headers, $body);
46 
47  $response = $this->request($request);
48  $this->assertEquals(201, $response->getStatus());
49  $subscriptions = $this->caldavBackend->getSubscriptionsForUser('principals/user1');
50  $this->assertSubscription($subscriptions[0]);
51 
52 
53  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
if(PHP_SAPI !='cli') color
Definition: langcheck.php:120
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response
+ Here is the call graph for this function:

Field Documentation

◆ $setupCalDAV

Sabre\CalDAV\Subscriptions\CreateSubscriptionTest::$setupCalDAV = true
protected

Definition at line 10 of file CreateSubscriptionTest.php.

◆ $setupCalDAVSubscriptions

Sabre\CalDAV\Subscriptions\CreateSubscriptionTest::$setupCalDAVSubscriptions = true
protected

Definition at line 11 of file CreateSubscriptionTest.php.


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