25                'principaluri'                  => 
'principals/user2',
 
   28                $caldavNS . 
'calendar-timezone' => 
"BEGIN:VCALENDAR\r\nBEGIN:VTIMEZONE\r\nTZID:Europe/Berlin\r\nEND:VTIMEZONE\r\nEND:VCALENDAR",
 
   31                'principaluri'                         => 
'principals/user2',
 
   40                'calendardata' => 
'BEGIN:VCALENDAR 
   42DTSTART:20110101T130000 
   50                'calendardata' => 
'BEGIN:VCALENDAR 
   52DTSTART:20110101T080000 
   70            'CONTENT_TYPE' => 
'text/calendar',
 
   72        $this->response = 
new HTTP\ResponseMock();
 
   79        $this->aclPlugin->allowUnauthenticatedAccess = 
false;
 
   80        $this->server->addPlugin($this->aclPlugin);
 
   86        $this->authPlugin->beforeMethod($this->request, $this->response);
 
   87        $this->server->addPlugin($this->authPlugin);
 
   91        $this->server->addPlugin($this->plugin);
 
   94        $this->plugin = 
new Plugin();
 
   95        $this->server->addPlugin($this->plugin);
 
  101        $this->server->httpRequest = 
new HTTP\Request(
 
  103            '/calendars/user1/outbox',
 
  104            [
'Content-Type' => 
'text/plain']
 
  108            $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse)
 
  115        $this->server->httpRequest = 
new HTTP\Request(
 
  117            '/calendars/user1/blabla',
 
  118            [
'Content-Type' => 
'text/calendar']
 
  122            $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse)
 
  129        $this->server->httpRequest = 
new HTTP\Request(
 
  131            '/calendars/user1/inbox',
 
  132            [
'Content-Type' => 
'text/calendar']
 
  136            $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse)
 
  146        $this->server->httpRequest = 
new HTTP\Request(
 
  148            '/calendars/user1/outbox',
 
  149            [
'Content-Type' => 
'text/calendar']
 
  159        $this->server->httpRequest->setBody($body);
 
  160        $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse);
 
  169        $this->server->httpRequest = 
new HTTP\Request(
 
  171            '/calendars/user1/outbox',
 
  172            [
'Content-Type' => 
'text/calendar']
 
  183        $this->server->httpRequest->setBody($body);
 
  184        $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse);
 
  193        $this->server->httpRequest = 
new HTTP\Request(
 
  195            '/calendars/user1/outbox',
 
  196            [
'Content-Type' => 
'text/calendar']
 
  204ORGANIZER:mailto:john@wayne.org
 
  209        $this->server->httpRequest->setBody($body);
 
  210        $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse);
 
  219        $this->server->httpRequest = 
new HTTP\Request(
 
  221            '/calendars/user1/outbox',
 
  222            [
'Content-Type' => 
'text/calendar']
 
  229ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  234        $this->server->httpRequest->setBody($body);
 
  235        $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse);
 
  244        $this->server->httpRequest = 
new HTTP\Request(
 
  246            '/calendars/user1/outbox',
 
  247            [
'Content-Type' => 
'text/calendar']
 
  254ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  255ATTENDEE:mailto:user2.sabredav@sabredav.org
 
  260        $this->server->httpRequest->setBody($body);
 
  261        $this->plugin->httpPost($this->server->httpRequest, $this->server->httpResponse);
 
  267        $this->server->httpRequest = 
new HTTP\Request(
 
  269            '/calendars/user1/outbox',
 
  270            [
'Content-Type' => 
'text/calendar']
 
  277ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  278ATTENDEE:mailto:user2.sabredav@sabredav.org
 
  279ATTENDEE:mailto:user3.sabredav@sabredav.org
 
  280DTSTART:20110101T080000Z
 
  281DTEND:20110101T180000Z
 
  286        $this->server->httpRequest->setBody($body);
 
  289        $this->aclPlugin->adminPrincipals[] = 
'principals/user1';
 
  292            $this->plugin->httpPost($this->server->httpRequest, $this->response)
 
  295        $this->assertEquals(200, $this->response->status);
 
  296        $this->assertEquals([
 
  297            'Content-Type' => [
'application/xml'],
 
  298        ], $this->response->getHeaders());
 
  301            '<d:href>mailto:user2.sabredav@sabredav.org</d:href>',
 
  302            '<d:href>mailto:user3.sabredav@sabredav.org</d:href>',
 
  303            '<cal:request-status>2.0;Success</cal:request-status>',
 
  304            '<cal:request-status>3.7;Could not find principal</cal:request-status>',
 
  305            'FREEBUSY:20110101T120000Z/20110101T130000Z',
 
  308        foreach ($strings as $string) {
 
  310                strpos($this->response->body, $string) !== 
false,
 
  311                'The response body did not contain: ' . $string . 
'Full response: ' . $this->response->body
 
  316            strpos($this->response->body, 
'FREEBUSY;FBTYPE=BUSY:20110101T080000Z/20110101T090000Z') == 
false,
 
  317            'The response body did contain free busy info from a transparent calendar.' 
  329        $this->caldavBackend->deleteCalendar(1);
 
  330        $this->caldavBackend->deleteCalendar(2);
 
  332        $this->server->httpRequest = 
new HTTP\Request(
 
  334            '/calendars/user1/outbox',
 
  335            [
'Content-Type' => 
'text/calendar']
 
  342ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  343ATTENDEE:mailto:user2.sabredav@sabredav.org
 
  344DTSTART:20110101T080000Z
 
  345DTEND:20110101T180000Z
 
  350        $this->server->httpRequest->setBody($body);
 
  353        $this->aclPlugin->adminPrincipals[] = 
'principals/user1';
 
  356            $this->plugin->httpPost($this->server->httpRequest, $this->response)
 
  359        $this->assertEquals(200, $this->response->status);
 
  360        $this->assertEquals([
 
  361            'Content-Type' => [
'application/xml'],
 
  362        ], $this->response->getHeaders());
 
  365            '<d:href>mailto:user2.sabredav@sabredav.org</d:href>',
 
  366            '<cal:request-status>2.0;Success</cal:request-status>',
 
  369        foreach ($strings as $string) {
 
  371                strpos($this->response->body, $string) !== 
false,
 
  372                'The response body did not contain: ' . $string . 
'Full response: ' . $this->response->body
 
  380        $this->server->httpRequest = 
new HTTP\Request(
 
  382            '/calendars/user1/outbox',
 
  383            [
'Content-Type' => 
'text/calendar']
 
  390ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  391ATTENDEE:mailto:user2.sabredav@sabredav.org
 
  392DTSTART:20110101T080000Z
 
  393DTEND:20110101T180000Z
 
  398        $this->server->httpRequest->setBody($body);
 
  401        $this->aclPlugin->adminPrincipals[] = 
'principals/user1';
 
  404        $this->server->on(
'propFind', 
function(DAV\
PropFind $propFind) {
 
  411            $this->plugin->httpPost($this->server->httpRequest, $this->response)
 
  414        $this->assertEquals(200, $this->response->status);
 
  415        $this->assertEquals([
 
  416            'Content-Type' => [
'application/xml'],
 
  417        ], $this->response->getHeaders());
 
  420            '<d:href>mailto:user2.sabredav@sabredav.org</d:href>',
 
  421            '<cal:request-status>3.7;No calendar-home-set property found</cal:request-status>',
 
  424        foreach ($strings as $string) {
 
  426                strpos($this->response->body, $string) !== 
false,
 
  427                'The response body did not contain: ' . $string . 
'Full response: ' . $this->response->body
 
  435        $this->server->httpRequest = 
new HTTP\Request(
 
  437            '/calendars/user1/outbox',
 
  438            [
'Content-Type' => 
'text/calendar']
 
  445ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  446ATTENDEE:mailto:user2.sabredav@sabredav.org
 
  447DTSTART:20110101T080000Z
 
  448DTEND:20110101T180000Z
 
  453        $this->server->httpRequest->setBody($body);
 
  456        $this->aclPlugin->adminPrincipals[] = 
'principals/user1';
 
  459        $this->server->on(
'propFind', 
function(DAV\
PropFind $propFind) {
 
  466            $this->plugin->httpPost($this->server->httpRequest, $this->response)
 
  469        $this->assertEquals(200, $this->response->status);
 
  470        $this->assertEquals([
 
  471            'Content-Type' => [
'application/xml'],
 
  472        ], $this->response->getHeaders());
 
  475            '<d:href>mailto:user2.sabredav@sabredav.org</d:href>',
 
  476            '<cal:request-status>3.7;No schedule-inbox-URL property found</cal:request-status>',
 
  479        foreach ($strings as $string) {
 
  481                strpos($this->response->body, $string) !== 
false,
 
  482                'The response body did not contain: ' . $string . 
'Full response: ' . $this->response->body
 
  490        $this->server->httpRequest = 
new HTTP\Request(
 
  492            '/calendars/user1/outbox',
 
  493            [
'Content-Type' => 
'text/calendar']
 
  500ORGANIZER:mailto:user1.sabredav@sabredav.org
 
  501ATTENDEE:mailto:user2.sabredav@sabredav.org
 
  502DTSTART:20110101T080000Z
 
  503DTEND:20110101T180000Z
 
  508        $this->server->httpRequest->setBody($body);
 
  511        $this->aclPlugin->adminPrincipals[] = 
'principals/user1';
 
  514        $this->server->on(
'propFind', 
function(DAV\
PropFind $propFind) {
 
  516            $propFind->handle(
'{' . 
Plugin::NS_CALDAV . 
'}calendar-availability', 
function() {
 
  521DTSTART:20110101T000000Z
 
  522DTEND:20110102T000000Z
 
  524DTSTART:20110101T090000Z
 
  525DTEND:20110101T170000Z
 
  537            $this->plugin->httpPost($this->server->httpRequest, $this->response)
 
  540        $this->assertEquals(200, $this->response->status);
 
  541        $this->assertEquals([
 
  542            'Content-Type' => [
'application/xml'],
 
  543        ], $this->response->getHeaders());
 
  546            '<d:href>mailto:user2.sabredav@sabredav.org</d:href>',
 
  547            '<cal:request-status>2.0;Success</cal:request-status>',
 
  548            'FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T080000Z/20110101T090000Z',
 
  549            'FREEBUSY:20110101T120000Z/20110101T130000Z',
 
  550            'FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T170000Z/20110101T180000Z',
 
  553        foreach ($strings as $string) {
 
  555                strpos($this->response->body, $string) !== 
false,
 
  556                'The response body did not contain: ' . $string . 
'Full response: ' . $this->response->body
 
An exception for terminatinating execution or to throw for unit testing.
const NS_CALDAV
This is the official CalDAV namespace.
testSucceedNoCalendars()
Testing if the freebusy request still works, even if there are no calendars in the target users' acco...
testNoAttendees()
@expectedException Sabre\DAV\Exception\BadRequest
testNoVFreeBusy()
@expectedException \Sabre\DAV\Exception\NotImplemented
testIncorrectOrganizer()
@expectedException Sabre\DAV\Exception\Forbidden
testNoCalendarHomeFound()
testNoItipMethod()
@expectedException Sabre\DAV\Exception\BadRequest
testNoDTStart()
@expectedException Sabre\DAV\Exception\BadRequest
testSucceedUseVAVAILABILITY()
schedule-calendar-transp property.
This plugin provides Authentication for a WebDAV server.
This class holds all the information about a PROPFIND request.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.