[Pkg-owncloud-commits] [php-sabredav] 147/220: CardDAV tests are passing. CalDAV wip

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:20 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 13c8559f520b95e729e0eca0913eef685fb4eaae
Author: Evert Pot <me at evertpot.com>
Date:   Mon Apr 11 04:15:04 2016 -0400

    CardDAV tests are passing. CalDAV wip
---
 lib/CalDAV/CalendarHome.php                 | 11 +++++++++++
 lib/CalDAV/CalendarObject.php               |  2 +-
 lib/CalDAV/Plugin.php                       |  1 +
 tests/Sabre/CalDAV/CalendarHomeTest.php     |  8 ++++----
 tests/Sabre/CalDAV/CalendarObjectTest.php   | 16 +++-------------
 tests/Sabre/CalDAV/CalendarTest.php         | 13 +------------
 tests/Sabre/CardDAV/AddressBookHomeTest.php | 11 +++--------
 tests/Sabre/CardDAV/AddressBookTest.php     | 11 +++--------
 tests/Sabre/CardDAV/CardTest.php            |  9 ++-------
 9 files changed, 29 insertions(+), 53 deletions(-)

diff --git a/lib/CalDAV/CalendarHome.php b/lib/CalDAV/CalendarHome.php
index 53de7da..0a4bfb6 100644
--- a/lib/CalDAV/CalendarHome.php
+++ b/lib/CalDAV/CalendarHome.php
@@ -272,6 +272,17 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
     }
 
     /**
+     * Returns the owner of the calendar home.
+     *
+     * @return string
+     */
+    function getOwner() {
+
+        return $this->principalInfo['uri'];
+
+    }
+
+    /**
      * Returns a list of ACE's for this node.
      *
      * Each ACE has the following properties:
diff --git a/lib/CalDAV/CalendarObject.php b/lib/CalDAV/CalendarObject.php
index 8a5af85..001b351 100644
--- a/lib/CalDAV/CalendarObject.php
+++ b/lib/CalDAV/CalendarObject.php
@@ -11,7 +11,7 @@ namespace Sabre\CalDAV;
  */
 class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\DAVACL\IACL {
 
-    use \Sabre\DAVACL\IACLTrait;
+    use \Sabre\DAVACL\ACLTrait;
 
     /**
      * Sabre\CalDAV\Backend\BackendInterface
diff --git a/lib/CalDAV/Plugin.php b/lib/CalDAV/Plugin.php
index ec3c077..c1ddec5 100644
--- a/lib/CalDAV/Plugin.php
+++ b/lib/CalDAV/Plugin.php
@@ -5,6 +5,7 @@ namespace Sabre\CalDAV;
 use DateTimeZone;
 use Sabre\DAV;
 use Sabre\DAV\Exception\BadRequest;
+use Sabre\DAV\INode;
 use Sabre\DAV\MkCol;
 use Sabre\DAV\Xml\Property\LocalHref;
 use Sabre\DAVACL;
diff --git a/tests/Sabre/CalDAV/CalendarHomeTest.php b/tests/Sabre/CalDAV/CalendarHomeTest.php
index d83af80..ff52ea6 100644
--- a/tests/Sabre/CalDAV/CalendarHomeTest.php
+++ b/tests/Sabre/CalDAV/CalendarHomeTest.php
@@ -95,7 +95,7 @@ class CalendarHomeTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException \Sabre\DAV\Exception\Forbidden
      */
     function testSetACL() {
 
@@ -104,7 +104,7 @@ class CalendarHomeTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\Forbidden
+     * @expectedException \Sabre\DAV\Exception\Forbidden
      * @depends testSimple
      */
     function testSetName() {
@@ -114,7 +114,7 @@ class CalendarHomeTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\Forbidden
+     * @expectedException \Sabre\DAV\Exception\Forbidden
      * @depends testSimple
      */
     function testDelete() {
@@ -133,7 +133,7 @@ class CalendarHomeTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException \Sabre\DAV\Exception\MethodNotAllowed
      * @depends testSimple
      */
     function testCreateFile() {
diff --git a/tests/Sabre/CalDAV/CalendarObjectTest.php b/tests/Sabre/CalDAV/CalendarObjectTest.php
index ecbaeef..0d98922 100644
--- a/tests/Sabre/CalDAV/CalendarObjectTest.php
+++ b/tests/Sabre/CalDAV/CalendarObjectTest.php
@@ -213,22 +213,12 @@ class CalendarObjectTest extends \PHPUnit_Framework_TestCase {
         $calendarObject = new CalendarObject($backend, ['principaluri' => 'principals/user1'], ['calendarid' => 1, 'uri' => 'foo']);
         $expected = [
             [
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1',
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}write',
+                'privilege' => '{DAV:}all',
                 'principal' => 'principals/user1',
                 'protected' => true,
             ],
             [
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1/calendar-proxy-write',
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}write',
+                'privilege' => '{DAV:}all',
                 'principal' => 'principals/user1/calendar-proxy-write',
                 'protected' => true,
             ],
@@ -244,7 +234,7 @@ class CalendarObjectTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException \Sabre\DAV\Exception\Forbidden
      */
     function testSetACL() {
 
diff --git a/tests/Sabre/CalDAV/CalendarTest.php b/tests/Sabre/CalDAV/CalendarTest.php
index 6be1e0d..df85b6d 100644
--- a/tests/Sabre/CalDAV/CalendarTest.php
+++ b/tests/Sabre/CalDAV/CalendarTest.php
@@ -226,7 +226,7 @@ class CalendarTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException \Sabre\DAV\Exception\Forbidden
      */
     function testSetACL() {
 
@@ -234,17 +234,6 @@ class CalendarTest extends \PHPUnit_Framework_TestCase {
 
     }
 
-    function testGetSupportedPrivilegesSet() {
-
-        $result = $this->calendar->getSupportedPrivilegeSet();
-
-        $this->assertEquals(
-            '{' . Plugin::NS_CALDAV . '}read-free-busy',
-            $result['aggregates'][0]['aggregates'][2]['privilege']
-        );
-
-    }
-
     function testGetSyncToken() {
 
         $this->assertNull($this->calendar->getSyncToken());
diff --git a/tests/Sabre/CardDAV/AddressBookHomeTest.php b/tests/Sabre/CardDAV/AddressBookHomeTest.php
index 007c011..969f7be 100644
--- a/tests/Sabre/CardDAV/AddressBookHomeTest.php
+++ b/tests/Sabre/CardDAV/AddressBookHomeTest.php
@@ -132,13 +132,8 @@ class AddressBookHomeTest extends \PHPUnit_Framework_TestCase {
         $this->assertNull($this->s->getGroup());
         $this->assertEquals([
             [
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1',
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}write',
-                'principal' => 'principals/user1',
+                'privilege' => '{DAV:}all',
+                'principal' => '{DAV:}owner',
                 'protected' => true,
             ],
         ], $this->s->getACL());
@@ -146,7 +141,7 @@ class AddressBookHomeTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException Sabre\DAV\Exception\Forbidden
      */
     function testSetACL() {
 
diff --git a/tests/Sabre/CardDAV/AddressBookTest.php b/tests/Sabre/CardDAV/AddressBookTest.php
index 0acd01a..9ca7ff1 100644
--- a/tests/Sabre/CardDAV/AddressBookTest.php
+++ b/tests/Sabre/CardDAV/AddressBookTest.php
@@ -131,13 +131,8 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase {
         $this->assertNull($this->ab->getGroup());
         $this->assertEquals([
             [
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1',
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}write',
-                'principal' => 'principals/user1',
+                'privilege' => '{DAV:}all',
+                'principal' => '{DAV:}owner',
                 'protected' => true,
             ],
         ], $this->ab->getACL());
@@ -145,7 +140,7 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException Sabre\DAV\Exception\Forbidden
      */
     function testSetACL() {
 
diff --git a/tests/Sabre/CardDAV/CardTest.php b/tests/Sabre/CardDAV/CardTest.php
index f9a9e83..cb7d152 100644
--- a/tests/Sabre/CardDAV/CardTest.php
+++ b/tests/Sabre/CardDAV/CardTest.php
@@ -151,12 +151,7 @@ class CardTest extends \PHPUnit_Framework_TestCase {
         $this->assertNull($this->card->getGroup());
         $this->assertEquals([
             [
-                'privilege' => '{DAV:}read',
-                'principal' => 'principals/user1',
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}write',
+                'privilege' => '{DAV:}all',
                 'principal' => 'principals/user1',
                 'protected' => true,
             ],
@@ -196,7 +191,7 @@ class CardTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException Sabre\DAV\Exception\Forbidden
      */
     function testSetACL() {
 

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