8 require_once
'Sabre/CalDAV/Backend/Mock.php';
9 require_once
'Sabre/HTTP/ResponseMock.php';
27 DTSTART:20111005T120000Z
33 $obj2 =
fopen(
'php://memory',
'r+');
37 DTSTART:20121005T120000Z
48 DTSTART:20111006T120000
58 'uri' =>
'event1.ics',
59 'calendardata' => $obj1,
63 'uri' =>
'event2.ics',
64 'calendardata' => $obj2
68 'uri' =>
'event3.ics',
69 'calendardata' => $obj3
80 'principaluri' =>
'principals/user1',
81 '{' .
Plugin::NS_CALDAV .
'}calendar-timezone' =>
"BEGIN:VCALENDAR\r\nBEGIN:VTIMEZONE\r\nTZID:Europe/Berlin\r\nEND:VTIMEZONE\r\nEND:VCALENDAR",
87 'REQUEST_URI' =>
'/calendar',
89 $this->server->httpRequest =
$request;
90 $this->server->httpResponse =
new HTTP\ResponseMock();
92 $this->plugin =
new Plugin();
93 $this->server->addPlugin($this->plugin);
100 <?xml version=
"1.0"?>
101 <c:free-busy-query xmlns:c=
"urn:ietf:params:xml:ns:caldav">
102 <c:time-range start=
"20111001T000000Z" end=
"20111101T000000Z" />
106 $report = $this->server->xml->parse($reportXML, null, $rootElem);
107 $this->plugin->report($rootElem, $report, null);
109 $this->assertEquals(200, $this->server->httpResponse->status);
110 $this->assertEquals(
'text/calendar', $this->server->httpResponse->getHeader(
'Content-Type'));
111 $this->assertTrue(strpos($this->server->httpResponse->body,
'BEGIN:VFREEBUSY') !==
false);
112 $this->assertTrue(strpos($this->server->httpResponse->body,
'20111005T120000Z/20111005T130000Z') !==
false);
113 $this->assertTrue(strpos($this->server->httpResponse->body,
'20111006T100000Z/20111006T110000Z') !==
false);
123 <?xml version=
"1.0"?>
124 <c:free-busy-query xmlns:c=
"urn:ietf:params:xml:ns:caldav">
128 $report = $this->server->xml->parse($reportXML, null, $rootElem);
138 'REQUEST_URI' =>
'/',
140 $this->server->httpRequest =
$request;
143 <?xml version=
"1.0"?>
144 <c:free-busy-query xmlns:c=
"urn:ietf:params:xml:ns:caldav">
145 <c:time-range start=
"20111001T000000Z" end=
"20111101T000000Z" />
149 $report = $this->server->xml->parse($reportXML, null, $rootElem);
150 $this->plugin->report($rootElem, $report, null);
160 $this->plugin =
new Plugin();
161 $this->server->addPlugin($this->plugin);
164 <?xml version=
"1.0"?>
165 <c:free-busy-query xmlns:c=
"urn:ietf:params:xml:ns:caldav">
166 <c:time-range start=
"20111001T000000Z" end=
"20111101T000000Z" />
170 $report = $this->server->xml->parse($reportXML, null, $rootElem);
171 $this->plugin->report($rootElem, $report, null);
foreach($paths as $path) $request
testFreeBusyReportWrongNode()
Sabre
testFreeBusyReportNoACLPlugin()
Sabre
testFreeBusyReportNoTimeRange()
Sabre
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
This object represents a CalDAV calendar.
const NS_CALDAV
This is the official CalDAV namespace.