[Pkg-owncloud-commits] [php-sabredav] 19/220: CalDAV backend works again, with multiple instances this time.

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:02 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 51207e72eea7a6f13833933b658a6675de28c765
Author: Evert Pot <me at evertpot.com>
Date:   Sun Oct 18 18:20:25 2015 -0400

    CalDAV backend works again, with multiple instances this time.
---
 lib/CalDAV/Backend/BackendInterface.php        |   2 +-
 lib/CalDAV/Backend/PDO.php                     | 131 +++++++++++++++++++------
 lib/DAV/CorePlugin.php                         |   6 +-
 tests/Sabre/CalDAV/Backend/AbstractPDOTest.php |  41 ++++----
 tests/Sabre/CalDAV/ICSExportPluginTest.php     |  34 +++----
 5 files changed, 139 insertions(+), 75 deletions(-)

diff --git a/lib/CalDAV/Backend/BackendInterface.php b/lib/CalDAV/Backend/BackendInterface.php
index 17b79f0..17a515d 100644
--- a/lib/CalDAV/Backend/BackendInterface.php
+++ b/lib/CalDAV/Backend/BackendInterface.php
@@ -63,7 +63,7 @@ interface BackendInterface {
      *
      * Read the PropPatch documentation for more info and examples.
      *
-     * @param string $path
+     * @param mixed $calendarId
      * @param \Sabre\DAV\PropPatch $propPatch
      * @return void
      */
diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php
index 97c90c0..65ff7ac 100644
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
@@ -21,8 +21,7 @@ class PDO extends AbstractBackend
     implements
         SyncSupport,
         SubscriptionSupport,
-        SchedulingSupport,
-        SharingSupport
+        SchedulingSupport
     {
 
     /**
@@ -57,7 +56,7 @@ class PDO extends AbstractBackend
      *
      * @var string
      */
-    public $calendarTableName = 'calendar_instances';
+    public $calendarInstancesTableName = 'calendar_instances';
 
     /**
      * The table name that will be used for calendar objects
@@ -167,7 +166,7 @@ class PDO extends AbstractBackend
         // Making fields a comma-delimited list
         $fields = implode(', ', $fields);
         $stmt = $this->pdo->prepare(<<<SQL
-SELECT $fields FROM {$this->calendarInstancesTableName}
+SELECT calendars.id as id, $fields FROM {$this->calendarInstancesTableName}
     LEFT JOIN {$this->calendarTableName} ON
         {$this->calendarInstancesTableName}.calendarid = {$this->calendarTableName}.id
 WHERE principaluri = ? ORDER BY calendarorder ASC
@@ -184,7 +183,7 @@ SQL
             }
 
             $calendar = [
-                'id'                                                                 => $row['id'],
+                'id'                                                                 => [$row['id'], $row['calendarid']],
                 'uri'                                                                => $row['uri'],
                 'principaluri'                                                       => $row['principaluri'],
                 '{' . CalDAV\Plugin::NS_CALENDARSERVER . '}getctag'                  => 'http://sabre.io/ns/sync/' . ($row['synctoken'] ? $row['synctoken'] : '0'),
@@ -203,7 +202,6 @@ SQL
                 $calendar['read-only'] = $row['access']===3;
             }
 
-
             foreach ($this->propertyMap as $xmlName => $dbName) {
                 $calendar[$xmlName] = $row[$dbName];
             }
@@ -259,7 +257,8 @@ SQL
         $stmt = $this->pdo->prepare("INSERT INTO " . $this->calendarTableName . " (synctoken, components) VALUES (1, ?)");
         $stmt->execute([$components]);
 
-        $values[':calendarid'] = $this->pdo->lastInsertId()
+        $calendarId = $this->pdo->lastInsertId();
+        $values[':calendarid'] = $calendarId;
 
         foreach ($this->propertyMap as $xmlName => $dbName) {
             if (isset($properties[$xmlName])) {
@@ -272,7 +271,7 @@ SQL
         $stmt = $this->pdo->prepare("INSERT INTO " . $this->calendarInstancesTableName . " (" . implode(', ', $fieldNames) . ") VALUES (" . implode(', ', array_keys($values)) . ")");
         $stmt->execute($values);
 
-        return $this->pdo->lastInsertId();
+        return [$calendarId, $this->pdo->lastInsertId()];
 
     }
 
@@ -288,16 +287,21 @@ SQL
      *
      * Read the PropPatch documenation for more info and examples.
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @param \Sabre\DAV\PropPatch $propPatch
      * @return void
      */
     function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $supportedProperties = array_keys($this->propertyMap);
         $supportedProperties[] = '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp';
 
-        $propPatch->handle($supportedProperties, function($mutations) use ($calendarId) {
+        $propPatch->handle($supportedProperties, function($mutations) use ($calendarId, $instanceId) {
             $newValues = [];
             foreach ($mutations as $propertyName => $propertyValue) {
 
@@ -319,7 +323,7 @@ SQL
             }
 
             $stmt = $this->pdo->prepare("UPDATE " . $this->calendarInstancesTableName . " SET " . implode(', ', $valuesSql) . " WHERE id = ?");
-            $newValues['id'] = $calendarId;
+            $newValues['id'] = $instanceId;
             $stmt->execute(array_values($newValues));
 
             $this->addChange($calendarId, "", 2);
@@ -333,19 +337,49 @@ SQL
     /**
      * Delete a calendar and all it's objects
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @return void
      */
     function deleteCalendar($calendarId) {
 
-        $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ?');
-        $stmt->execute([$calendarId]);
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
 
-        $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarTableName . ' WHERE id = ?');
-        $stmt->execute([$calendarId]);
+        $stmt = $this->pdo->prepare('SELECT access FROM ' . $this->calendarInstancesTableName . ' where id = ?');
+        $stmt->execute([$instanceId]);
+        $access = $stmt->fetchColumn();
+
+        if ($access === 1) {
+
+            /**
+             * If the user is the owner of the calendar, we delete all data and all
+             * instances.
+             **/ 
+            $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ?');
+            $stmt->execute([$calendarId]);
+
+            $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarChangesTableName . ' WHERE calendarid = ?');
+            $stmt->execute([$calendarId]);
+
+            $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarInstancesTableName . ' WHERE calendarid = ?');
+            $stmt->execute([$calendarId]);
+
+            $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarTableName . ' WHERE id = ?');
+            $stmt->execute([$calendarId]);
+
+        } else {
+
+            /**
+             * If it was an instance of a shared calendar, we only delete that
+             * instance.
+             */
+            $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarInstancesTableName . ' WHERE id = ?');
+            $stmt->execute([$instanceId]);
+
+        }
 
-        $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarChangesTableName . ' WHERE calendarid = ?');
-        $stmt->execute([$calendarId]);
 
     }
 
@@ -377,11 +411,16 @@ SQL
      * used/fetched to determine these numbers. If both are specified the
      * amount of times this is needed is reduced by a great degree.
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @return array
      */
     function getCalendarObjects($calendarId) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $stmt = $this->pdo->prepare('SELECT id, uri, lastmodified, etag, calendarid, size, componenttype FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ?');
         $stmt->execute([$calendarId]);
 
@@ -392,7 +431,6 @@ SQL
                 'uri'          => $row['uri'],
                 'lastmodified' => $row['lastmodified'],
                 'etag'         => '"' . $row['etag'] . '"',
-                'calendarid'   => $row['calendarid'],
                 'size'         => (int)$row['size'],
                 'component'    => strtolower($row['componenttype']),
             ];
@@ -414,12 +452,17 @@ SQL
      *
      * This method must return null if the object did not exist.
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @param string $objectUri
      * @return array|null
      */
     function getCalendarObject($calendarId, $objectUri) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $stmt = $this->pdo->prepare('SELECT id, uri, lastmodified, etag, calendarid, size, calendardata, componenttype FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ? AND uri = ?');
         $stmt->execute([$calendarId, $objectUri]);
         $row = $stmt->fetch(\PDO::FETCH_ASSOC);
@@ -431,7 +474,6 @@ SQL
             'uri'           => $row['uri'],
             'lastmodified'  => $row['lastmodified'],
             'etag'          => '"' . $row['etag'] . '"',
-            'calendarid'    => $row['calendarid'],
             'size'          => (int)$row['size'],
             'calendardata'  => $row['calendardata'],
             'component'     => strtolower($row['componenttype']),
@@ -453,6 +495,11 @@ SQL
      */
     function getMultipleCalendarObjects($calendarId, array $uris) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $query = 'SELECT id, uri, lastmodified, etag, calendarid, size, calendardata, componenttype FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ? AND uri IN (';
         // Inserting a whole bunch of question marks
         $query .= implode(',', array_fill(0, count($uris), '?'));
@@ -469,7 +516,6 @@ SQL
                 'uri'          => $row['uri'],
                 'lastmodified' => $row['lastmodified'],
                 'etag'         => '"' . $row['etag'] . '"',
-                'calendarid'   => $row['calendarid'],
                 'size'         => (int)$row['size'],
                 'calendardata' => $row['calendardata'],
                 'component'    => strtolower($row['componenttype']),
@@ -501,6 +547,11 @@ SQL
      */
     function createCalendarObject($calendarId, $objectUri, $calendarData) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $extraData = $this->getDenormalizedData($calendarData);
 
         $stmt = $this->pdo->prepare('INSERT INTO ' . $this->calendarObjectTableName . ' (calendarid, uri, calendardata, lastmodified, etag, size, componenttype, firstoccurence, lastoccurence, uid) VALUES (?,?,?,?,?,?,?,?,?,?)');
@@ -542,6 +593,11 @@ SQL
      */
     function updateCalendarObject($calendarId, $objectUri, $calendarData) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $extraData = $this->getDenormalizedData($calendarData);
 
         $stmt = $this->pdo->prepare('UPDATE ' . $this->calendarObjectTableName . ' SET calendardata = ?, lastmodified = ?, etag = ?, size = ?, componenttype = ?, firstoccurence = ?, lastoccurence = ?, uid = ? WHERE calendarid = ? AND uri = ?');
@@ -640,12 +696,17 @@ SQL
      *
      * The object uri is only the basename, or filename and not a full path.
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @param string $objectUri
      * @return void
      */
     function deleteCalendarObject($calendarId, $objectUri) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarObjectTableName . ' WHERE calendarid = ? AND uri = ?');
         $stmt->execute([$calendarId, $objectUri]);
 
@@ -701,12 +762,17 @@ SQL
      * This specific implementation (for the PDO) backend optimizes filters on
      * specific components, and VEVENT time-ranges.
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @param array $filters
      * @return array
      */
     function calendarQuery($calendarId, array $filters) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         $componentType = null;
         $requirePostFilter = true;
         $timeRange = null;
@@ -802,14 +868,14 @@ SQL
 
         $query = <<<SQL
 SELECT
-    calendars.uri AS calendaruri, calendarobjects.uri as objecturi
+    calendar_instances.uri AS calendaruri, calendarobjects.uri as objecturi
 FROM
     $this->calendarObjectTableName AS calendarobjects
 LEFT JOIN
-    $this->calendarTableName AS calendars
-    ON calendarobjects.calendarid = calendars.id
+    $this->calendarInstancesTableName AS calendar_instances
+    ON calendarobjects.calendarid = calendar_instances.calendarid
 WHERE
-    calendars.principaluri = ?
+    calendar_instances.principaluri = ?
     AND
     calendarobjects.uid = ?
 SQL;
@@ -873,7 +939,7 @@ SQL;
      *
      * The limit is 'suggestive'. You are free to ignore it.
      *
-     * @param string $calendarId
+     * @param mixed $calendarId
      * @param string $syncToken
      * @param int $syncLevel
      * @param int $limit
@@ -881,6 +947,11 @@ SQL;
      */
     function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) {
 
+        if (!is_array($calendarId)) {
+            throw new \LogicException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
+        }
+        list($calendarId, $instanceId) = $calendarId;
+
         // Current synctoken
         $stmt = $this->pdo->prepare('SELECT synctoken FROM ' . $this->calendarTableName . ' WHERE id = ?');
         $stmt->execute([ $calendarId ]);
diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php
index 3fdb92a..6d2039c 100644
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@ -846,10 +846,8 @@ class CorePlugin extends ServerPlugin {
         if ($node instanceof IProperties && $propertyNames = $propFind->get404Properties()) {
 
             $nodeProperties = $node->getProperties($propertyNames);
-            foreach ($propertyNames as $propertyName) {
-                if (array_key_exists($propertyName, $nodeProperties)) {
-                    $propFind->set($propertyName, $nodeProperties[$propertyName], 200);
-                }
+            foreach ($nodeProperties as $propertyName=>$propertyValue) {
+                $propFind->set($propertyName, $propertyValue, 200);
             }
 
         }
diff --git a/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php b/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
index 9dcfdea..ef094d1 100644
--- a/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
+++ b/tests/Sabre/CalDAV/Backend/AbstractPDOTest.php
@@ -42,7 +42,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
         $calendars = $backend->getCalendarsForUser('principals/user2');
 
         $elementCheck = array(
-            'id'                => $returnedId,
             'uri'               => 'somerandomid',
             '{DAV:}displayname' => 'Hello!',
             '{urn:ietf:params:xml:ns:caldav}calendar-description' => '',
@@ -207,7 +206,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
                 'size' => strlen($object),
                 'calendardata' => $object,
                 'lastmodified' => null,
-                'calendarid' => $returnedId,
             ],
             [
                 'id' => 2,
@@ -216,7 +214,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
                 'size' => strlen($object),
                 'calendardata' => $object,
                 'lastmodified' => null,
-                'calendarid' => $returnedId,
             ],
         ];
 
@@ -413,7 +410,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
         $this->assertEquals(1, count($data));
         $data = $data[0];
 
-        $this->assertEquals($returnedId, $data['calendarid']);
         $this->assertEquals('random-id', $data['uri']);
         $this->assertEquals(strlen($object),$data['size']);
 
@@ -456,7 +452,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
         $data = $backend->getCalendarObject($returnedId,'random-id');
 
         $this->assertEquals($object2, $data['calendardata']);
-        $this->assertEquals($returnedId, $data['calendarid']);
         $this->assertEquals('random-id', $data['uri']);
 
 
@@ -499,15 +494,15 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
         );
 
         $this->assertEquals(array(
-        ), $abstract->calendarQuery(1, $filters));
+        ), $abstract->calendarQuery([1,1], $filters));
 
     }
 
     function testCalendarQueryTodo() {
 
         $backend = new PDO($this->pdo);
-        $backend->createCalendarObject(1, "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
 
         $filters = array(
             'name' => 'VCALENDAR',
@@ -527,14 +522,14 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(array(
             "todo",
-        ), $backend->calendarQuery(1, $filters));
+        ), $backend->calendarQuery([1,1], $filters));
 
     }
     function testCalendarQueryTodoNotMatch() {
 
         $backend = new PDO($this->pdo);
-        $backend->createCalendarObject(1, "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
 
         $filters = array(
             'name' => 'VCALENDAR',
@@ -561,15 +556,15 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
         );
 
         $this->assertEquals(array(
-        ), $backend->calendarQuery(1, $filters));
+        ), $backend->calendarQuery([1,1], $filters));
 
     }
 
     function testCalendarQueryNoFilter() {
 
         $backend = new PDO($this->pdo);
-        $backend->createCalendarObject(1, "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
 
         $filters = array(
             'name' => 'VCALENDAR',
@@ -579,7 +574,7 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
             'time-range' => null,
         );
 
-        $result = $backend->calendarQuery(1, $filters);
+        $result = $backend->calendarQuery([1,1], $filters);
         $this->assertTrue(in_array('todo', $result));
         $this->assertTrue(in_array('event', $result));
 
@@ -588,9 +583,9 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
     function testCalendarQueryTimeRange() {
 
         $backend = new PDO($this->pdo);
-        $backend->createCalendarObject(1, "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
 
         $filters = array(
             'name' => 'VCALENDAR',
@@ -613,15 +608,15 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(array(
             "event2",
-        ), $backend->calendarQuery(1, $filters));
+        ), $backend->calendarQuery([1,1], $filters));
 
     }
     function testCalendarQueryTimeRangeNoEnd() {
 
         $backend = new PDO($this->pdo);
-        $backend->createCalendarObject(1, "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
-        $backend->createCalendarObject(1, "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
+        $backend->createCalendarObject([1,1], "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
 
         $filters = array(
             'name' => 'VCALENDAR',
@@ -644,7 +639,7 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(array(
             "event2",
-        ), $backend->calendarQuery(1, $filters));
+        ), $backend->calendarQuery([1,1], $filters));
 
     }
 
diff --git a/tests/Sabre/CalDAV/ICSExportPluginTest.php b/tests/Sabre/CalDAV/ICSExportPluginTest.php
index f7e4432..e1f2903 100644
--- a/tests/Sabre/CalDAV/ICSExportPluginTest.php
+++ b/tests/Sabre/CalDAV/ICSExportPluginTest.php
@@ -34,7 +34,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = [
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
             '{DAV:}displayname' => 'Hello!',
             '{http://apple.com/ns/ical/}calendar-color' => '#AA0000FF',
         ];
@@ -84,7 +84,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = [
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         ];
         $tree = [
             new Calendar($cbackend,$props),
@@ -148,7 +148,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -185,7 +185,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -276,7 +276,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -312,7 +312,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -352,7 +352,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -388,7 +388,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -428,7 +428,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -466,7 +466,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -503,7 +503,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         $tree = array(
             new Calendar($cbackend,$props),
@@ -541,10 +541,10 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = array(
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         );
         // add a todo to the calendar (see /tests/Sabre/TestUtil)
-        $cbackend->createCalendarObject(1, 'UUID-3456', TestUtil::getTestTODO());
+        $cbackend->createCalendarObject([1,1], 'UUID-3456', TestUtil::getTestTODO());
 
         $tree = array(
             new Calendar($cbackend,$props),
@@ -585,10 +585,10 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = [
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         ];
         // add a todo to the calendar (see /tests/Sabre/TestUtil)
-        $cbackend->createCalendarObject(1, 'UUID-3456', TestUtil::getTestTODO());
+        $cbackend->createCalendarObject([1,1], 'UUID-3456', TestUtil::getTestTODO());
 
         $tree = [
             new Calendar($cbackend,$props),
@@ -629,10 +629,10 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
         $props = [
             'uri'=>'UUID-123467',
             'principaluri' => 'admin',
-            'id' => 1,
+            'id' => [1,1],
         ];
         // add a todo to the calendar (see /tests/Sabre/TestUtil)
-        $cbackend->createCalendarObject(1, 'UUID-3456', TestUtil::getTestTODO());
+        $cbackend->createCalendarObject([1,1], 'UUID-3456', TestUtil::getTestTODO());
 
         $tree = [
             new Calendar($cbackend,$props),

-- 
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