[Pkg-owncloud-commits] [php-sabredav] 47/220: Making CalDAV sharing work again. wip

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 9b299e0c56d65fcd68b69180e1dc91fc4710af36
Author: Evert Pot <me at evertpot.com>
Date:   Mon Jan 11 21:52:25 2016 -0500

    Making CalDAV sharing work again. wip
---
 lib/CalDAV/Schedule/Plugin.php                     |   2 +-
 lib/CalDAV/SharedCalendar.php                      |  75 ++++++------
 lib/CalDAV/SharingPlugin.php                       |  15 +--
 tests/Sabre/CalDAV/Backend/MockSharing.php         |  13 +-
 .../CalDAV/CalendarHomeSharedCalendarsTest.php     |   6 +-
 tests/Sabre/CalDAV/CalendarHomeTest.php            |   2 +-
 tests/Sabre/CalDAV/SharedCalendarTest.php          |   4 +-
 .../CalDAV/Xml/Notification/InviteReplyTest.php    |  67 +++++------
 tests/Sabre/CalDAV/Xml/Notification/InviteTest.php | 134 ++++++++-------------
 9 files changed, 133 insertions(+), 185 deletions(-)

diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php
index 502d8d4..f212cec 100644
--- a/lib/CalDAV/Schedule/Plugin.php
+++ b/lib/CalDAV/Schedule/Plugin.php
@@ -257,7 +257,7 @@ class Plugin extends ServerPlugin {
                     }
                     if (isset($child[200]['{DAV:}share-access'])) {
                         $shareAccess = $child[200]['{DAV:}share-access']->getValue();
-                        if ($shareAccess !== Sharing\Plugin::ACCESS_NOTSHARED && $shareAccess !== Sharing\Plugin::ACCESS_OWNER) {
+                        if ($shareAccess !== Sharing\Plugin::ACCESS_NOTSHARED && $shareAccess !== Sharing\Plugin::ACCESS_SHAREDOWNER) {
                             // Node is a shared node, not owned by the relevant
                             // user.
                             continue;
diff --git a/lib/CalDAV/SharedCalendar.php b/lib/CalDAV/SharedCalendar.php
index eb71f50..cf29668 100644
--- a/lib/CalDAV/SharedCalendar.php
+++ b/lib/CalDAV/SharedCalendar.php
@@ -28,71 +28,70 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
     }
 
     /**
-     * Returns the list of people whom this resource is shared with.
+     * This function must return a URI that uniquely identifies the shared
+     * resource. This URI should be identical across instances, and is
+     * also used in several other XML bodies to connect invites to
+     * resources.
      *
-     * Every element in this array should have the following properties:
-     *   * href - Often a mailto: address
-     *   * commonName - Optional, for example a first + last name
-     *   * status - See the Sabre\DAV\Sharing\Plugin::STATUS_ constants.
-     *   * access - one of the Sabre\DAV\Sharing\Plugin::ACCESS_ constants.
+     * This may simply be a relative reference to the original shared instance,
+     * but it could also be a urn. As long as it's a valid URI and unique.
      *
-     * @return array
+     * @return string
      */
-    function getShares() {
+    function getShareResourceUri() {
 
-        return $this->caldavBackend->getShares($this->calendarInfo['id']);
+        throw new \Exception('Not implemented');
 
     }
 
     /**
-     * Marks this calendar as published.
+     * Updates the list of sharees.
      *
-     * Publishing a calendar should automatically create a read-only, public,
-     * subscribable calendar.
+     * Every item must be a Sharee object.
      *
-     * @param bool $value
+     * @param \Sabre\DAV\Xml\Element\Sharee[] $sharees
      * @return void
      */
-    function setPublishStatus($value) {
+    function updateInvites(array $sharees) {
 
-        $this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value);
+        $this->caldavBackend->updateShares($this->calendarInfo['id'], $sharees);
 
     }
 
     /**
-     * Updates the list of shares.
+     * Returns the list of people whom this resource is shared with.
      *
-     * The first array is a list of people that are to be added to the
-     * calendar.
+     * Every item in the returned array must be a Sharee object with
+     * at least the following properties set:
      *
-     * Every element in the add array has the following properties:
-     *   * href - A url. Usually a mailto: address
-     *   * commonName - Usually a first and last name, or false
-     *   * summary - A description of the share, can also be false
-     *   * readOnly - A boolean value
+     * * $href
+     * * $shareAccess
+     * * $inviteStatus
      *
-     * Every element in the remove array is just the address string.
+     * and optionally:
      *
-     * @param array $add
-     * @param array $remove
-     * @return void
+     * * $properties
+     *
+     * @return \Sabre\DAV\Xml\Element\Sharee[]
      */
-    function updateShares(array $add, array $remove) {
+    function getInvites() {
 
-        $this->caldavBackend->updateShares($this->calendarInfo['id'], $add, $remove);
+        return $this->caldavBackend->getShares($this->calendarInfo['id']);
 
     }
 
     /**
-     * Returns the owner principal
+     * Marks this calendar as published.
      *
-     * This must be a url to a principal, or null if there's no owner
+     * Publishing a calendar should automatically create a read-only, public,
+     * subscribable calendar.
      *
-     * @return string|null
+     * @param bool $value
+     * @return void
      */
-    function getOwner() {
+    function setPublishStatus($value) {
 
-        return $this->calendarInfo['principaluri'];
+        $this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value);
 
     }
 
@@ -114,7 +113,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
 
         switch ($this->getShareAccess()) {
             case SPlugin::ACCESS_NOTSHARED :
-            case SPlugin::ACCESS_OWNER :
+            case SPlugin::ACCESS_SHAREDOWNER :
                 $acl[] = [
                     'privilege' => '{DAV:}share',
                     'principal' => $this->calendarInfo['principaluri'],
@@ -138,7 +137,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
                     'protected' => true,
                 ];
                 // No break intentional!
-            case SPlugin::ACCESS_READONLY :
+            case SPlugin::ACCESS_READ :
                 $acl[] = [
                     'privilege' => '{DAV:}write-properties',
                     'principal' => $this->calendarInfo['principaluri'],
@@ -212,7 +211,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
         switch ($this->getShareAccess()) {
             case SPlugin::ACCESS_NOTSHARED :
                 // No break intentional
-            case SPlugin::ACCESS_OWNER :
+            case SPlugin::ACCESS_SHAREDOWNER :
                 // No break intentional
             case SPlugin::ACCESS_READWRITE:
                 $acl[] = [
@@ -226,7 +225,7 @@ class SharedCalendar extends Calendar implements ISharedCalendar {
                     'protected' => true,
                 ];
                 // No break intentional
-            case SPlugin::ACCESS_READONLY:
+            case SPlugin::ACCESS_READ:
                 $acl[] = [
                     'privilege' => '{DAV:}read',
                     'principal' => $this->calendarInfo['principaluri'],
diff --git a/lib/CalDAV/SharingPlugin.php b/lib/CalDAV/SharingPlugin.php
index f91c0c7..bb669de 100644
--- a/lib/CalDAV/SharingPlugin.php
+++ b/lib/CalDAV/SharingPlugin.php
@@ -26,15 +26,6 @@ use Sabre\HTTP\ResponseInterface;
 class SharingPlugin extends DAV\ServerPlugin {
 
     /**
-     * These are the various status constants used by sharing-messages.
-     */
-    const STATUS_ACCEPTED = 1;
-    const STATUS_DECLINED = 2;
-    const STATUS_DELETED = 3;
-    const STATUS_NORESPONSE = 4;
-    const STATUS_INVALID = 5;
-
-    /**
      * Reference to SabreDAV server object.
      *
      * @var Sabre\DAV\Server
@@ -170,10 +161,10 @@ class SharingPlugin extends DAV\ServerPlugin {
             $shareAccess = $node->getShareAccess();
             if ($rt = $propFind->get('{DAV:}resourcetype')) {
                 switch ($shareAccess) {
-                    case \Sabre\DAV\Sharing\Plugin::ACCESS_OWNER :
+                    case \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER :
                         $rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared-owner');
                         break;
-                    case \Sabre\DAV\Sharing\Plugin::ACCESS_READONLY :
+                    case \Sabre\DAV\Sharing\Plugin::ACCESS_READ :
                     case \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE :
                         $rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared');
                         break;
@@ -209,7 +200,7 @@ class SharingPlugin extends DAV\ServerPlugin {
         if (!$node instanceof ISharedCalendar)
             return;
 
-        if ($node->getShareAccess() === \Sabre\DAV\Sharing\Plugin::ACCESS_OWNER || $node->getShareAccess() === \Sabre\DAV\Sharing\Plugin::ACCESS_NOTSHARED) {
+        if ($node->getShareAccess() === \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER || $node->getShareAccess() === \Sabre\DAV\Sharing\Plugin::ACCESS_NOTSHARED) {
 
             $propPatch->handle('{DAV:}resourcetype', function($value) use ($node) {
                 if ($value->is('{' . Plugin::NS_CALENDARSERVER . '}shared-owner')) return false;
diff --git a/tests/Sabre/CalDAV/Backend/MockSharing.php b/tests/Sabre/CalDAV/Backend/MockSharing.php
index 4de3428..2b6cc9f 100644
--- a/tests/Sabre/CalDAV/Backend/MockSharing.php
+++ b/tests/Sabre/CalDAV/Backend/MockSharing.php
@@ -3,7 +3,6 @@
 namespace Sabre\CalDAV\Backend;
 
 use Sabre\DAV;
-use Sabre\CalDAV;
 use Sabre\CalDAV\Xml\Notification\NotificationInterface;
 
 class MockSharing extends Mock implements NotificationSupport, SharingSupport {
@@ -44,9 +43,9 @@ class MockSharing extends Mock implements NotificationSupport, SharingSupport {
                 continue;
             }
             if (!empty($this->shares[$calendar['id']])) {
-                $calendar['share-access'] = \Sabre\DAV\Sharing\Plugin::ACCESS_OWNER;
+                $calendar['share-access'] = DAV\Sharing\Plugin::ACCESS_OWNER;
             } else {
-                $calendar['share-access'] = \Sabre\DAV\Sharing\Plugin::ACCESS_NOTSHARED;
+                $calendar['share-access'] = DAV\Sharing\Plugin::ACCESS_NOTSHARED;
             }
             $calendars[$k] = $calendar;
 
@@ -122,7 +121,7 @@ class MockSharing extends Mock implements NotificationSupport, SharingSupport {
         }
 
         foreach ($add as $val) {
-            $val['status'] = CalDAV\SharingPlugin::STATUS_NORESPONSE;
+            $val['status'] = DAV\Sharing\Plugin::INVITE_NORESPONSE;
             $this->shares[$calendarId][] = $val;
         }
 
@@ -145,7 +144,7 @@ class MockSharing extends Mock implements NotificationSupport, SharingSupport {
      * Every element in this array should have the following properties:
      *   * href - Often a mailto: address
      *   * commonName - Optional, for example a first + last name
-     *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
+     *   * status - See the Sabre\DAV\Sharing\Plugin::INVITE_ constants.
      *   * readOnly - boolean
      *   * summary - Optional, a description for the share
      *
@@ -166,7 +165,7 @@ class MockSharing extends Mock implements NotificationSupport, SharingSupport {
      * This method is called when a user replied to a request to share.
      *
      * @param string href The sharee who is replying (often a mailto: address)
-     * @param int status One of the SharingPlugin::STATUS_* constants
+     * @param int status One of the \Sabre\DAV\Sharing\Plugin::INVITE_* constants
      * @param string $calendarUri The url to the calendar thats being shared
      * @param string $inReplyTo The unique id this message is a response to
      * @param string $summary A description of the reply
@@ -175,7 +174,7 @@ class MockSharing extends Mock implements NotificationSupport, SharingSupport {
     function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = null) {
 
         // This operation basically doesn't do anything yet
-        if ($status === CalDAV\SharingPlugin::STATUS_ACCEPTED) {
+        if ($status === DAV\Sharing\Plugin::INVITE_ACCEPTED) {
             return 'calendars/blabla/calendar';
         }
 
diff --git a/tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php b/tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php
index 40c5878..9079fde 100644
--- a/tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php
+++ b/tests/Sabre/CalDAV/CalendarHomeSharedCalendarsTest.php
@@ -2,10 +2,8 @@
 
 namespace Sabre\CalDAV;
 
-require_once 'Sabre/CalDAV/TestUtil.php';
+use Sabre\DAV;
 
-/**
- */
 class CalendarHomeSharedCalendarsTest extends \PHPUnit_Framework_TestCase {
 
     protected $backend;
@@ -74,7 +72,7 @@ class CalendarHomeSharedCalendarsTest extends \PHPUnit_Framework_TestCase {
     function testShareReply() {
 
         $instance = $this->getInstance();
-        $result = $instance->shareReply('uri', SharingPlugin::STATUS_DECLINED, 'curi', '1');
+        $result = $instance->shareReply('uri', DAV\Sharing\Plugin::INVITE_DECLINED, 'curi', '1');
         $this->assertNull($result);
 
     }
diff --git a/tests/Sabre/CalDAV/CalendarHomeTest.php b/tests/Sabre/CalDAV/CalendarHomeTest.php
index ec238c6..d83af80 100644
--- a/tests/Sabre/CalDAV/CalendarHomeTest.php
+++ b/tests/Sabre/CalDAV/CalendarHomeTest.php
@@ -208,7 +208,7 @@ class CalendarHomeTest extends \PHPUnit_Framework_TestCase {
      */
     function testShareReplyFail() {
 
-        $this->usercalendars->shareReply('uri', SharingPlugin::STATUS_DECLINED, 'curi', '1');
+        $this->usercalendars->shareReply('uri', DAV\Sharing\Plugin::INVITE_DECLINED, 'curi', '1');
 
     }
 
diff --git a/tests/Sabre/CalDAV/SharedCalendarTest.php b/tests/Sabre/CalDAV/SharedCalendarTest.php
index 8bac377..0b4e1ba 100644
--- a/tests/Sabre/CalDAV/SharedCalendarTest.php
+++ b/tests/Sabre/CalDAV/SharedCalendarTest.php
@@ -44,8 +44,8 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase {
             'href'       => 'mailto:removeme at example.org',
             'commonName' => 'To be removed',
             'readOnly'   => true,
-            'status'     => SharingPlugin::STATUS_NORESPONSE,
-        ]], $this->getInstance()->getShares());
+            'status'     => Sharing\Plugin::INVITE_NORESPONSE,
+        ]], $this->getInstance()->getInvites());
 
     }
 
diff --git a/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php b/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php
index 50e31a8..a1c6145 100644
--- a/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php
+++ b/tests/Sabre/CalDAV/Xml/Notification/InviteReplyTest.php
@@ -2,7 +2,6 @@
 
 namespace Sabre\CalDAV\Xml\Notification;
 
-use Sabre\CalDAV;
 use Sabre\DAV;
 use Sabre\Xml\Writer;
 
@@ -36,7 +35,7 @@ class InviteReplyTest extends \PHPUnit_Framework_TestCase {
         $writer->contextUri = '/';
         $writer->namespaceMap = [
             'http://calendarserver.org/ns/' => 'cs',
-            'DAV:' => 'd',
+            'DAV:'                          => 'd',
         ];
         $writer->openMemory();
         $writer->startDocument('1.0', 'UTF-8');
@@ -52,17 +51,17 @@ class InviteReplyTest extends \PHPUnit_Framework_TestCase {
     function dataProvider() {
 
         $dtStamp = new \DateTime('2012-01-01 00:00:00 GMT');
-        return array(
-            array(
-                array(
-                    'id' => 'foo',
-                    'dtStamp' => $dtStamp,
-                    'etag' => '"1"',
+        return [
+            [
+                [
+                    'id'        => 'foo',
+                    'dtStamp'   => $dtStamp,
+                    'etag'      => '"1"',
                     'inReplyTo' => 'bar',
-                    'href' => 'mailto:foo at example.org',
-                    'type' => CalDAV\SharingPlugin::STATUS_ACCEPTED,
-                    'hostUrl' => 'calendar'
-                ),
+                    'href'      => 'mailto:foo at example.org',
+                    'type'      => DAV\Sharing\Plugin::INVITE_ACCEPTED,
+                    'hostUrl'   => 'calendar'
+                ],
 <<<FOO
 <?xml version="1.0" encoding="UTF-8"?>
 <cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:">
@@ -79,18 +78,18 @@ class InviteReplyTest extends \PHPUnit_Framework_TestCase {
 </cs:root>
 
 FOO
-            ),
-            array(
-                array(
-                    'id' => 'foo',
-                    'dtStamp' => $dtStamp,
-                    'etag' => '"1"',
+            ],
+            [
+                [
+                    'id'        => 'foo',
+                    'dtStamp'   => $dtStamp,
+                    'etag'      => '"1"',
                     'inReplyTo' => 'bar',
-                    'href' => 'mailto:foo at example.org',
-                    'type' => CalDAV\SharingPlugin::STATUS_DECLINED,
-                    'hostUrl' => 'calendar',
-                    'summary' => 'Summary!'
-                ),
+                    'href'      => 'mailto:foo at example.org',
+                    'type'      => DAV\Sharing\Plugin::INVITE_DECLINED,
+                    'hostUrl'   => 'calendar',
+                    'summary'   => 'Summary!'
+                ],
 <<<FOO
 <?xml version="1.0" encoding="UTF-8"?>
 <cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:">
@@ -108,9 +107,9 @@ FOO
 </cs:root>
 
 FOO
-            ),
+            ],
 
-        );
+        ];
 
     }
 
@@ -119,7 +118,7 @@ FOO
      */
     function testMissingArg() {
 
-        new InviteReply(array());
+        new InviteReply([]);
 
     }
 
@@ -128,17 +127,17 @@ FOO
      */
     function testUnknownArg() {
 
-        new InviteReply(array(
+        new InviteReply([
             'foo-i-will-break' => true,
 
-            'id' => 1,
-            'etag' => '"bla"',
-            'href' => 'abc',
-            'dtStamp' => 'def',
+            'id'        => 1,
+            'etag'      => '"bla"',
+            'href'      => 'abc',
+            'dtStamp'   => 'def',
             'inReplyTo' => 'qrs',
-            'type' => 'ghi',
-            'hostUrl' => 'jkl',
-        ));
+            'type'      => 'ghi',
+            'hostUrl'   => 'jkl',
+        ]);
 
     }
 
diff --git a/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php b/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php
index 54b9aae..22f1854 100644
--- a/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php
+++ b/tests/Sabre/CalDAV/Xml/Notification/InviteTest.php
@@ -36,20 +36,20 @@ class InviteTest extends DAV\Xml\XmlTest {
     function dataProvider() {
 
         $dtStamp = new \DateTime('2012-01-01 00:00:00', new \DateTimeZone('GMT'));
-        return array(
-            array(
-                array(
-                    'id' => 'foo',
-                    'dtStamp' => $dtStamp,
-                    'etag' => '"1"',
-                    'href' => 'mailto:foo at example.org',
-                    'type' => CalDAV\SharingPlugin::STATUS_ACCEPTED,
-                    'readOnly' => true,
-                    'hostUrl' => 'calendar',
-                    'organizer' => 'principal/user1',
+        return [
+            [
+                [
+                    'id'         => 'foo',
+                    'dtStamp'    => $dtStamp,
+                    'etag'       => '"1"',
+                    'href'       => 'mailto:foo at example.org',
+                    'type'       => DAV\Sharing\Plugin::INVITE_ACCEPTED,
+                    'readOnly'   => true,
+                    'hostUrl'    => 'calendar',
+                    'organizer'  => 'principal/user1',
                     'commonName' => 'John Doe',
-                    'summary' => 'Awesome stuff!'
-                ),
+                    'summary'    => 'Awesome stuff!'
+                ],
 <<<FOO
 <?xml version="1.0" encoding="UTF-8"?>
 <cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:cal="urn:ietf:params:xml:ns:caldav">
@@ -74,19 +74,19 @@ class InviteTest extends DAV\Xml\XmlTest {
 </cs:root>
 
 FOO
-            ),
-            array(
-                array(
-                    'id' => 'foo',
-                    'dtStamp' => $dtStamp,
-                    'etag' => '"1"',
-                    'href' => 'mailto:foo at example.org',
-                    'type' => CalDAV\SharingPlugin::STATUS_DECLINED,
-                    'readOnly' => true,
-                    'hostUrl' => 'calendar',
-                    'organizer' => 'principal/user1',
+            ],
+            [
+                [
+                    'id'         => 'foo',
+                    'dtStamp'    => $dtStamp,
+                    'etag'       => '"1"',
+                    'href'       => 'mailto:foo at example.org',
+                    'type'       => DAV\Sharing\Plugin::INVITE_DECLINED,
+                    'readOnly'   => true,
+                    'hostUrl'    => 'calendar',
+                    'organizer'  => 'principal/user1',
                     'commonName' => 'John Doe',
-                ),
+                ],
 <<<FOO
 <?xml version="1.0" encoding="UTF-8"?>
 <cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:cal="urn:ietf:params:xml:ns:caldav">
@@ -109,20 +109,20 @@ FOO
   </cs:invite-notification>
 </cs:root>
 FOO
-            ),
-            array(
-                array(
-                    'id' => 'foo',
-                    'dtStamp' => $dtStamp,
-                    'etag' => '"1"',
-                    'href' => 'mailto:foo at example.org',
-                    'type' => CalDAV\SharingPlugin::STATUS_NORESPONSE,
-                    'readOnly' => true,
-                    'hostUrl' => 'calendar',
+            ],
+            [
+                [
+                    'id'        => 'foo',
+                    'dtStamp'   => $dtStamp,
+                    'etag'      => '"1"',
+                    'href'      => 'mailto:foo at example.org',
+                    'type'      => DAV\Sharing\Plugin::INVITE_NORESPONSE,
+                    'readOnly'  => true,
+                    'hostUrl'   => 'calendar',
                     'organizer' => 'principal/user1',
                     'firstName' => 'Foo',
                     'lastName'  => 'Bar',
-                ),
+                ],
 <<<FOO
 <?xml version="1.0" encoding="UTF-8"?>
 <cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:cal="urn:ietf:params:xml:ns:caldav">
@@ -148,47 +148,9 @@ FOO
 </cs:root>
 
 FOO
-            ),
-            array(
-                array(
-                    'id' => 'foo',
-                    'dtStamp' => $dtStamp,
-                    'etag' => '"1"',
-                    'href' => 'mailto:foo at example.org',
-                    'type' => CalDAV\SharingPlugin::STATUS_DELETED,
-                    'readOnly' => false,
-                    'hostUrl' => 'calendar',
-                    'organizer' => 'mailto:user1 at fruux.com',
-                    'supportedComponents' => new CalDAV\Xml\Property\SupportedCalendarComponentSet(['VEVENT','VTODO']),
-                ),
-<<<FOO
-<?xml version="1.0" encoding="UTF-8"?>
-<cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:" xmlns:cal="urn:ietf:params:xml:ns:caldav">
-  <cs:dtstamp>20120101T000000Z</cs:dtstamp>
-  <cs:invite-notification>
-    <cs:uid>foo</cs:uid>
-    <d:href>mailto:foo at example.org</d:href>
-    <cs:invite-deleted/>
-    <cs:hosturl>
-      <d:href>/calendar</d:href>
-    </cs:hosturl>
-    <cs:access>
-      <cs:read-write/>
-    </cs:access>
-    <cs:organizer>
-      <d:href>mailto:user1 at fruux.com</d:href>
-    </cs:organizer>
-    <cal:supported-calendar-component-set>
-      <cal:comp name="VEVENT"/>
-      <cal:comp name="VTODO"/>
-    </cal:supported-calendar-component-set>
-  </cs:invite-notification>
-</cs:root>
-
-FOO
-            ),
+            ],
 
-        );
+        ];
 
     }
 
@@ -197,7 +159,7 @@ FOO
      */
     function testMissingArg() {
 
-        new Invite(array());
+        new Invite([]);
 
     }
 
@@ -206,18 +168,18 @@ FOO
      */
     function testUnknownArg() {
 
-        new Invite(array(
+        new Invite([
             'foo-i-will-break' => true,
 
-            'id' => 1,
-            'etag' => '"bla"',
-            'href' => 'abc',
-            'dtStamp' => 'def',
-            'type' => 'ghi',
-            'readOnly' => true,
-            'hostUrl' => 'jkl',
+            'id'        => 1,
+            'etag'      => '"bla"',
+            'href'      => 'abc',
+            'dtStamp'   => 'def',
+            'type'      => 'ghi',
+            'readOnly'  => true,
+            'hostUrl'   => 'jkl',
             'organizer' => 'mno',
-        ));
+        ]);
 
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-php/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list