18        $this->caldavCalendars = [
 
   20                'principaluri' => 
'principals/user1',
 
   25                'principaluri' => 
'principals/user1',
 
   31                'principaluri' => 
'principals/user1',
 
   40        $this->aclPlugin->adminPrincipals[] = 
'principals/user2';
 
   46        $this->assertInstanceOf(
'Sabre\\CalDAV\\SharingPlugin', $this->server->getPlugin(
'caldav-sharing'));
 
   49            $this->caldavSharingPlugin->getPluginInfo()[
'name']
 
   68        $this->assertEquals([
'calendarserver-sharing'], $this->caldavSharingPlugin->getFeatures());
 
   75        $this->authPlugin->beforeMethod(
new HTTP\
Request(), 
new HTTP\
Response());
 
   76        $props = $this->server->getProperties(
'calendars/user1/cal1', [
 
   82        $this->assertInstanceOf(
'Sabre\\CalDAV\\Xml\\Property\\AllowedSharingModes', $props[
'{' . 
Plugin::NS_CALENDARSERVER . 
'}allowed-sharing-modes']);
 
   88        $props = $this->server->getProperties(
'calendars/user1/cal2', [
 
  100        $this->caldavBackend->updateInvites(1,
 
  103                    'href' => 
'mailto:joe@example.org',
 
  107        $result = $this->server->updateProperties(
'calendars/user1/cal1', [
 
  111        $this->assertEquals([
 
  112            '{DAV:}resourcetype' => 200
 
  115        $this->assertEquals(0, count($this->caldavBackend->getInvites(1)));
 
  121        $result = $this->server->updateProperties(
'calendars/user1/cal3', [
 
  122            '{DAV:}foo' => 
'bar',
 
  125        $this->assertEquals([
 
  134            'REQUEST_METHOD' => 
'PATCH',
 
  135            'REQUEST_URI'    => 
'/',
 
  147            'REQUEST_METHOD' => 
'POST',
 
  148            'REQUEST_URI'    => 
'/',
 
  149            'CONTENT_TYPE'   => 
'text/plain',
 
  161            'REQUEST_METHOD' => 
'POST',
 
  162            'REQUEST_URI'    => 
'/foo',
 
  163            'CONTENT_TYPE'   => 
'text/xml',
 
  174        $request = 
new HTTP\Request(
'POST', 
'/calendars/user1/cal1', [
'Content-Type' => 
'text/xml']);
 
  178<cs:share xmlns:cs=
"http://calendarserver.org/ns/" xmlns:d=
"DAV:">
 
  180        <d:href>mailto:joe@example.org</d:href>
 
  181        <cs:common-name>Joe Shmoe</cs:common-name>
 
  185        <d:href>mailto:nancy@example.org</d:href>
 
  197                    'href'       => 
'mailto:joe@example.org',
 
  199                        '{DAV:}displayname' => 
'Joe Shmoe',
 
  201                    'access'       => \
Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE,
 
  202                    'inviteStatus' => \
Sabre\DAV\Sharing\Plugin::INVITE_NORESPONSE,
 
  206            $this->caldavBackend->getInvites(1)
 
  210        $this->server->tree->markDirty(
'');
 
  213        $props = $this->server->getProperties(
'calendars/user1/cal1', [
'{DAV:}resourcetype']);
 
  215            $props[
'{DAV:}resourcetype']->is(
'{http://calendarserver.org/ns/}shared-owner')
 
  224            '/calendars/user1/cal2',
 
  225            [
'Content-Type' => 
'text/xml']
 
  228        $xml = 
'<?xml version="1.0"?> 
  231        <d:href>mailto:joe@example.org</d:href> 
  232        <cs:common-name>Joe Shmoe</cs:common-name> 
  236        <d:href>mailto:nancy@example.org</d:href> 
  250            'REQUEST_METHOD' => 
'POST',
 
  251            'REQUEST_URI'    => 
'/calendars/user1',
 
  252            'CONTENT_TYPE'   => 
'text/xml',
 
  255        $xml = 
'<?xml version="1.0"?> 
  257    <cs:hosturl><d:href>/principals/owner</d:href></cs:hosturl> 
  258    <cs:invite-accepted /> 
  271            'REQUEST_METHOD' => 
'POST',
 
  272            'REQUEST_URI'    => 
'/calendars/user1',
 
  273            'CONTENT_TYPE'   => 
'text/xml',
 
  276        $xml = 
'<?xml version="1.0"?> 
  289            'REQUEST_METHOD' => 
'POST',
 
  290            'REQUEST_URI'    => 
'/calendars/user1/cal1',
 
  291            'CONTENT_TYPE'   => 
'text/xml',
 
  294        $xml = 
'<?xml version="1.0"?> 
  296    <cs:hosturl><d:href>/principals/owner</d:href></cs:hosturl> 
  311        $request = 
new HTTP\Request(
'POST', 
'/calendars/user1/cal1', [
'Content-Type' => 
'text/xml']);
 
  313        $xml = 
'<?xml version="1.0"?> 
  329            '/calendars/user1/cal1',
 
  330            [
'Content-Type' => 
'text/xml']
 
  333        $xml = 
'<?xml version="1.0"?> 
  349            [
'Content-Type' => 
'text/xml']
 
  352        $xml = 
'<?xml version="1.0"?> 
  366            [
'Content-Type' => 
'text/xml']
 
  368        $xml = 
'<?xml version="1.0"?> 
  383            '/calendars/user1/cal2',
 
  384            [
'Content-Type' => 
'text/xml']
 
  387        $xml = 
'<?xml version="1.0"?> 
foreach($paths as $path) $request
An exception for terminatinating execution or to throw for unit testing.
const NS_CALENDARSERVER
This is the namespace for the proprietary calendarserver extensions.
testUpdatePropertiesPassThru()
testBeforeGetShareableCalendar()
testUnknownMethodNoNode()
testBeforeGetSharedCalendar()
testShareRequestNoShareableCalendar()
testSetupWithoutCoreSharingPlugin()
@expectedException \LogicException
testUnknownMethodNoPOST()
This plugin implements support for caldav sharing.
This class may be used as a basis for other webdav-related unittests.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
This class represents the {DAV:}sharee element.
{DAV:}resourcetype property
The Request class represents a single HTTP request.
This class represents a single HTTP response.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.