[Pkg-owncloud-commits] [php-sabredav] 146/220: Fixed DAVACL tests.

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

    Fixed DAVACL tests.
---
 lib/CalDAV/CalendarHome.php                        |  2 +-
 lib/CalDAV/Notifications/Collection.php            |  2 +-
 lib/CalDAV/Plugin.php                              |  2 +-
 lib/CalDAV/Subscriptions/Subscription.php          |  4 +-
 lib/DAV/Sharing/Plugin.php                         |  4 +-
 lib/DAVACL/FS/Collection.php                       |  1 +
 lib/DAVACL/FS/File.php                             |  2 +-
 lib/DAVACL/FS/HomeCollection.php                   |  2 +-
 lib/DAVACL/Plugin.php                              | 60 ++++++++++++----------
 lib/DAVACL/Principal.php                           |  2 +-
 lib/DAVACL/PrincipalCollection.php                 |  3 +-
 lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php  | 10 ++--
 tests/Sabre/DAVACL/ACLMethodTest.php               |  7 ++-
 tests/Sabre/DAVACL/AllowAccessTest.php             | 15 ++----
 tests/Sabre/DAVACL/FS/HomeCollectionTest.php       |  9 +---
 tests/Sabre/DAVACL/PluginPropertiesTest.php        |  7 ++-
 tests/Sabre/DAVACL/PrincipalTest.php               |  6 +--
 tests/Sabre/DAVACL/SimplePluginTest.php            | 17 ++----
 .../Xml/Property/SupportedPrivilegeSetTest.php     | 20 ++------
 19 files changed, 76 insertions(+), 99 deletions(-)

diff --git a/lib/CalDAV/CalendarHome.php b/lib/CalDAV/CalendarHome.php
index 3d23c3b..53de7da 100644
--- a/lib/CalDAV/CalendarHome.php
+++ b/lib/CalDAV/CalendarHome.php
@@ -22,7 +22,7 @@ use Sabre\HTTP\URLUtil;
  */
 class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL {
 
-    use DAVACL\IACLTrait;
+    use DAVACL\ACLTrait;
 
     /**
      * CalDAV backend
diff --git a/lib/CalDAV/Notifications/Collection.php b/lib/CalDAV/Notifications/Collection.php
index aba7e0d..5fda61d 100644
--- a/lib/CalDAV/Notifications/Collection.php
+++ b/lib/CalDAV/Notifications/Collection.php
@@ -22,7 +22,7 @@ use Sabre\DAVACL;
  */
 class Collection extends DAV\Collection implements ICollection, DAVACL\IACL {
 
-    use DAVACL\IACLTrait;
+    use DAVACL\ACLTrait;
 
     /**
      * The notification backend
diff --git a/lib/CalDAV/Plugin.php b/lib/CalDAV/Plugin.php
index 92109ef..ec3c077 100644
--- a/lib/CalDAV/Plugin.php
+++ b/lib/CalDAV/Plugin.php
@@ -970,7 +970,7 @@ class Plugin extends DAV\ServerPlugin {
 
         if ($node instanceof ISharedNode) {
             $supportedPrivilegeSet['{DAV:}read']['aggregates']['{' . self::NS_CALDAV . '}read-free-busy'] = [
-                'abstract' => false,
+                'abstract'   => false,
                 'aggregates' => [],
             ];
         }
diff --git a/lib/CalDAV/Subscriptions/Subscription.php b/lib/CalDAV/Subscriptions/Subscription.php
index de74650..3bb3451 100644
--- a/lib/CalDAV/Subscriptions/Subscription.php
+++ b/lib/CalDAV/Subscriptions/Subscription.php
@@ -5,8 +5,8 @@ namespace Sabre\CalDAV\Subscriptions;
 use Sabre\DAV\Collection;
 use Sabre\DAV\Xml\Property\Href;
 use Sabre\DAV\PropPatch;
-use Sabre\DAV\Exception\MethodNotAllowed;
 use Sabre\DAVACL\IACL;
+use Sabre\DAVACL\ACLTrait;
 use Sabre\CalDAV\Backend\SubscriptionSupport;
 
 /**
@@ -20,6 +20,8 @@ use Sabre\CalDAV\Backend\SubscriptionSupport;
  */
 class Subscription extends Collection implements ISubscription, IACL {
 
+    use ACLTrait;
+
     /**
      * caldavBackend
      *
diff --git a/lib/DAV/Sharing/Plugin.php b/lib/DAV/Sharing/Plugin.php
index c19e0e0..38c1c13 100644
--- a/lib/DAV/Sharing/Plugin.php
+++ b/lib/DAV/Sharing/Plugin.php
@@ -229,8 +229,8 @@ class Plugin extends ServerPlugin {
     function getSupportedPrivilegeSet(INode $node, array &$supportedPrivilegeSet) {
 
         if ($node instanceof ISharedNode) {
-            $supportedPrivilegeSet['{DAV:}share'][
-                'abstract' => false,
+            $supportedPrivilegeSet['{DAV:}share'] = [
+                'abstract'   => false,
                 'aggregates' => [],
             ];
         }
diff --git a/lib/DAVACL/FS/Collection.php b/lib/DAVACL/FS/Collection.php
index f26f0ee..1c08b43 100644
--- a/lib/DAVACL/FS/Collection.php
+++ b/lib/DAVACL/FS/Collection.php
@@ -3,6 +3,7 @@
 namespace Sabre\DAVACL\FS;
 
 use Sabre\DAV\FSExt\Directory as BaseCollection;
+use Sabre\DAVACL\ACLTrait;
 use Sabre\DAVACL\IACL;
 use Sabre\DAV\Exception\Forbidden;
 use Sabre\DAV\Exception\NotFound;
diff --git a/lib/DAVACL/FS/File.php b/lib/DAVACL/FS/File.php
index 88de206..387597b 100644
--- a/lib/DAVACL/FS/File.php
+++ b/lib/DAVACL/FS/File.php
@@ -4,7 +4,7 @@ namespace Sabre\DAVACL\FS;
 
 use Sabre\DAV\FSExt\File as BaseFile;
 use Sabre\DAVACL\IACL;
-use Sabre\DAV\Exception\Forbidden;
+use Sabre\DAVACL\ACLTrait;
 
 /**
  * This is an ACL-enabled file node.
diff --git a/lib/DAVACL/FS/HomeCollection.php b/lib/DAVACL/FS/HomeCollection.php
index 4adf085..9e21353 100644
--- a/lib/DAVACL/FS/HomeCollection.php
+++ b/lib/DAVACL/FS/HomeCollection.php
@@ -2,8 +2,8 @@
 
 namespace Sabre\DAVACL\FS;
 
-use Sabre\DAV\Exception\Forbidden;
 use Sabre\DAVACL\AbstractPrincipalCollection;
+use Sabre\DAVACL\ACLTrait;
 use Sabre\DAVACL\IACL;
 use Sabre\DAVACL\PrincipalBackend\BackendInterface;
 use Sabre\Uri;
diff --git a/lib/DAVACL/Plugin.php b/lib/DAVACL/Plugin.php
index 1d6830d..68acf75 100644
--- a/lib/DAVACL/Plugin.php
+++ b/lib/DAVACL/Plugin.php
@@ -416,7 +416,7 @@ class Plugin extends DAV\ServerPlugin {
 
         $supportedPrivileges = null;
         if ($node instanceof IACL) {
-            $supportedPrivileges = $node->getSupportedPrivileges();
+            $supportedPrivileges = $node->getSupportedPrivilegeSet();
         }
 
         if (is_null($supportedPrivileges)) {
@@ -427,36 +427,33 @@ class Plugin extends DAV\ServerPlugin {
                     'abstract'   => false,
                     'aggregates' => [
                         '{DAV:}read-acl' => [
-                            'abstract'  => false,
+                            'abstract'   => false,
                             'aggregates' => [],
                         ],
                         '{DAV:}read-current-user-privilege-set' => [
-                            'abstract'  => false,
+                            'abstract'   => false,
                             'aggregates' => [],
                         ],
                     ],
                 ],
-                [
-                    'privilege'  => '{DAV:}write',
+                '{DAV:}write' => [
                     'abstract'   => false,
                     'aggregates' => [
                         '{DAV:}write-properties' => [
-                            'abstract'  => false,
+                            'abstract'   => false,
+                            'aggregates' => [],
+                        ],
+                        '{DAV:}write-content' => [
+                            'abstract' => false,
                             'aggregates' => [],
                         ],
                         '{DAV:}unlock' => [
-                            'abstract'  => false,
+                            'abstract'   => false,
                             'aggregates' => [],
                         ],
                     ],
                 ],
             ];
-            if ($node instanceof \Sabre\DAV\IFile) {
-                $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}write-content'] = [
-                    'abstract'   => false,
-                    'aggregates' => [],
-                ];
-            }
             if ($node instanceof \Sabre\DAV\ICollection) {
                 $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}bind'] = [
                     'abstract'   => false,
@@ -467,7 +464,7 @@ class Plugin extends DAV\ServerPlugin {
                     'aggregates' => [],
                 ];
             }
-            if ($node instanceof \Sabre\DAV\IACL) {
+            if ($node instanceof \Sabre\DAVACL\IACL) {
                 $supportedPrivileges['{DAV:}write']['aggregates']['{DAV:}write-acl'] = [
                     'abstract'   => false,
                     'aggregates' => [],
@@ -501,35 +498,38 @@ class Plugin extends DAV\ServerPlugin {
      */
     final function getFlatPrivilegeSet($node) {
 
-        $privs = $this->getSupportedPrivilegeSet($node);
+        $privs = [
+            'abstract'   => false,
+            'aggregates' => $this->getSupportedPrivilegeSet($node)
+        ];
 
         $fpsTraverse = null;
-        $fpsTraverse = function($priv, $concrete, &$flat) use (&$fpsTraverse) {
+        $fpsTraverse = function($privName, $privInfo, $concrete, &$flat) use (&$fpsTraverse) {
 
             $myPriv = [
-                'privilege'  => $priv['privilege'],
-                'abstract'   => isset($priv['abstract']) && $priv['abstract'],
+                'privilege'  => $privName,
+                'abstract'   => isset($privInfo['abstract']) && $privInfo['abstract'],
                 'aggregates' => [],
-                'concrete'   => isset($priv['abstract']) && $priv['abstract'] ? $concrete : $priv['privilege'],
+                'concrete'   => isset($privInfo['abstract']) && $privInfo['abstract'] ? $concrete : $privName,
             ];
 
-            if (isset($priv['aggregates'])) {
+            if (isset($privInfo['aggregates'])) {
 
-                foreach ($priv['aggregates'] as $subPriv) {
+                foreach ($privInfo['aggregates'] as $subPrivName => $subPrivInfo) {
 
-                    $myPriv['aggregates'][] = $subPriv['privilege'];
+                    $myPriv['aggregates'][] = $subPrivName;
 
                 }
 
             }
 
-            $flat[$priv['privilege']] = $myPriv;
+            $flat[$privName] = $myPriv;
 
-            if (isset($priv['aggregates'])) {
+            if (isset($privInfo['aggregates'])) {
 
-                foreach ($priv['aggregates'] as $subPriv) {
+                foreach ($privInfo['aggregates'] as $subPrivName => $subPrivInfo) {
 
-                    $fpsTraverse($subPriv, $myPriv['concrete'], $flat);
+                    $fpsTraverse($subPrivName, $subPrivInfo, $myPriv['concrete'], $flat);
 
                 }
 
@@ -538,7 +538,7 @@ class Plugin extends DAV\ServerPlugin {
         };
 
         $flat = [];
-        $fpsTraverse($privs, null, $flat);
+        $fpsTraverse('{DAV:}all', $privs, null, $flat);
 
         return $flat;
 
@@ -840,7 +840,6 @@ class Plugin extends DAV\ServerPlugin {
 
             case 'PUT' :
             case 'LOCK' :
-            case 'UNLOCK' :
                 // This method requires the write-content priv if the node
                 // already exists, and bind on the parent if the node is being
                 // created.
@@ -849,6 +848,11 @@ class Plugin extends DAV\ServerPlugin {
                 break;
 
 
+            case 'UNLOCK' :
+                // Unlock is always allowed at the moment.
+                break;
+
+
             case 'PROPPATCH' :
                 $this->checkPrivileges($path, '{DAV:}write-properties');
                 break;
diff --git a/lib/DAVACL/Principal.php b/lib/DAVACL/Principal.php
index 49ab406..6ebb309 100644
--- a/lib/DAVACL/Principal.php
+++ b/lib/DAVACL/Principal.php
@@ -22,7 +22,7 @@ use Sabre\HTTP\URLUtil;
  */
 class Principal extends DAV\Node implements IPrincipal, DAV\IProperties, IACL {
 
-    use IACLTrait;
+    use ACLTrait;
 
     /**
      * Struct with principal information.
diff --git a/lib/DAVACL/PrincipalCollection.php b/lib/DAVACL/PrincipalCollection.php
index 5c98bc0..d8a9015 100644
--- a/lib/DAVACL/PrincipalCollection.php
+++ b/lib/DAVACL/PrincipalCollection.php
@@ -3,7 +3,6 @@
 namespace Sabre\DAVACL;
 
 use Sabre\DAV\Exception\InvalidResourceType;
-use Sabre\DAV\Exception\Forbidden;
 use Sabre\DAV\IExtendedCollection;
 use Sabre\DAV\MkCol;
 
@@ -19,7 +18,7 @@ use Sabre\DAV\MkCol;
  */
 class PrincipalCollection extends AbstractPrincipalCollection implements IExtendedCollection, IACL {
 
-    use IACLTrait;
+    use ACLTrait;
 
     /**
      * This method returns a node for a principal.
diff --git a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
index 572bed4..7c41abf 100644
--- a/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
+++ b/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
@@ -73,7 +73,7 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
      */
     function xmlSerialize(Writer $writer) {
 
-        $this->serializePriv($writer, $this->privileges);
+        $this->serializePriv($writer, '{DAV:}all', [ 'aggregates' => $this->privileges]);
 
     }
 
@@ -132,12 +132,12 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
      * @param array $privilege
      * @return void
      */
-    private function serializePriv(Writer $writer, $privilege) {
+    private function serializePriv(Writer $writer, $privName, $privilege) {
 
         $writer->startElement('{DAV:}supported-privilege');
 
         $writer->startElement('{DAV:}privilege');
-        $writer->writeElement($privilege['privilege']);
+        $writer->writeElement($privName);
         $writer->endElement(); // privilege
 
         if (!empty($privilege['abstract'])) {
@@ -147,8 +147,8 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
             $writer->writeElement('{DAV:}description', $privilege['description']);
         }
         if (isset($privilege['aggregates'])) {
-            foreach ($privilege['aggregates'] as $subPrivilege) {
-                $this->serializePriv($writer, $subPrivilege);
+            foreach ($privilege['aggregates'] as $subPrivName => $subPrivilege) {
+                $this->serializePriv($writer, $subPrivName, $subPrivilege);
             }
         }
 
diff --git a/tests/Sabre/DAVACL/ACLMethodTest.php b/tests/Sabre/DAVACL/ACLMethodTest.php
index 72a6041..8c899ff 100644
--- a/tests/Sabre/DAVACL/ACLMethodTest.php
+++ b/tests/Sabre/DAVACL/ACLMethodTest.php
@@ -150,12 +150,15 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
         ];
         $acl = new Plugin();
         $server = new DAV\Server($tree);
+        $server->on('getSupportedPrivilegeSet', function($node, &$supportedPrivilegeSet) {
+            $supportedPrivilegeSet['{DAV:}foo'] = ['abstract' => true];
+        });
         $server->httpRequest = new HTTP\Request('ACL', '/test');
         $body = '<?xml version="1.0"?>
 <d:acl xmlns:d="DAV:">
     <d:ace>
-        <d:grant><d:privilege><d:all /></d:privilege></d:grant>
-        <d:principal><d:href>/principals/notfound</d:href></d:principal>
+        <d:grant><d:privilege><d:foo /></d:privilege></d:grant>
+        <d:principal><d:href>/principals/foo/</d:href></d:principal>
     </d:ace>
 </d:acl>';
         $server->httpRequest->setBody($body);
diff --git a/tests/Sabre/DAVACL/AllowAccessTest.php b/tests/Sabre/DAVACL/AllowAccessTest.php
index 9b17556..9b4b539 100644
--- a/tests/Sabre/DAVACL/AllowAccessTest.php
+++ b/tests/Sabre/DAVACL/AllowAccessTest.php
@@ -14,7 +14,9 @@ class AllowAccessTest extends \PHPUnit_Framework_TestCase {
     function setUp() {
 
         $nodes = [
-            new DAV\SimpleCollection('testdir'),
+            new DAV\Mock\Collection('testdir', [
+                'file1.txt' => 'contents',
+            ]),
         ];
 
         $this->server = new DAV\Server($nodes);
@@ -63,16 +65,7 @@ class AllowAccessTest extends \PHPUnit_Framework_TestCase {
     function testPUT() {
 
         $this->server->httpRequest->setMethod('PUT');
-        $this->server->httpRequest->setUrl('/testdir');
-
-        $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
-
-    }
-
-    function testACL() {
-
-        $this->server->httpRequest->setMethod('ACL');
-        $this->server->httpRequest->setUrl('/testdir');
+        $this->server->httpRequest->setUrl('/testdir/file1.txt');
 
         $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
 
diff --git a/tests/Sabre/DAVACL/FS/HomeCollectionTest.php b/tests/Sabre/DAVACL/FS/HomeCollectionTest.php
index 0f9c65a..87cfc83 100644
--- a/tests/Sabre/DAVACL/FS/HomeCollectionTest.php
+++ b/tests/Sabre/DAVACL/FS/HomeCollectionTest.php
@@ -52,13 +52,8 @@ class HomeCollectionTest extends \PHPUnit_Framework_TestCase {
         $owner = 'principals/user1';
         $acl = [
             [
-                'privilege' => '{DAV:}read',
-                'principal' => $owner,
-                'protected' => true,
-            ],
-            [
-                'privilege' => '{DAV:}write',
-                'principal' => $owner,
+                'privilege' => '{DAV:}all',
+                'principal' => '{DAV:}owner',
                 'protected' => true,
             ],
         ];
diff --git a/tests/Sabre/DAVACL/PluginPropertiesTest.php b/tests/Sabre/DAVACL/PluginPropertiesTest.php
index 3fd84bf..8665816 100644
--- a/tests/Sabre/DAVACL/PluginPropertiesTest.php
+++ b/tests/Sabre/DAVACL/PluginPropertiesTest.php
@@ -102,18 +102,17 @@ class PluginPropertiesTest extends \PHPUnit_Framework_TestCase {
             '/d:root/d:supported-privilege'                                                                                           => 1,
             '/d:root/d:supported-privilege/d:privilege'                                                                               => 1,
             '/d:root/d:supported-privilege/d:privilege/d:all'                                                                         => 1,
-            '/d:root/d:supported-privilege/d:abstract'                                                                                => 1,
+            '/d:root/d:supported-privilege/d:abstract'                                                                                => 0,
             '/d:root/d:supported-privilege/d:supported-privilege'                                                                     => 2,
             '/d:root/d:supported-privilege/d:supported-privilege/d:privilege'                                                         => 2,
             '/d:root/d:supported-privilege/d:supported-privilege/d:privilege/d:read'                                                  => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:privilege/d:write'                                                 => 1,
-            '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege'                                               => 8,
-            '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege'                                   => 8,
+            '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege'                                               => 7,
+            '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege'                                   => 7,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:read-acl'                        => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:read-current-user-privilege-set' => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:write-content'                   => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:write-properties'                => 1,
-            '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:write-acl'                       => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:bind'                            => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:unbind'                          => 1,
             '/d:root/d:supported-privilege/d:supported-privilege/d:supported-privilege/d:privilege/d:unlock'                          => 1,
diff --git a/tests/Sabre/DAVACL/PrincipalTest.php b/tests/Sabre/DAVACL/PrincipalTest.php
index f19a819..20622ad 100644
--- a/tests/Sabre/DAVACL/PrincipalTest.php
+++ b/tests/Sabre/DAVACL/PrincipalTest.php
@@ -178,8 +178,8 @@ class PrincipalTest extends \PHPUnit_Framework_TestCase {
         $principal = new Principal($principalBackend, ['uri' => 'principals/admin']);
         $this->assertEquals([
             [
-                'privilege' => '{DAV:}read',
-                'principal' => '{DAV:}authenticated',
+                'privilege' => '{DAV:}all',
+                'principal' => '{DAV:}owner',
                 'protected' => true,
             ]
         ], $principal->getACL());
@@ -187,7 +187,7 @@ class PrincipalTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+     * @expectedException \Sabre\DAV\Exception\Forbidden
      */
     function testSetACl() {
 
diff --git a/tests/Sabre/DAVACL/SimplePluginTest.php b/tests/Sabre/DAVACL/SimplePluginTest.php
index 40a89f3..4b65970 100644
--- a/tests/Sabre/DAVACL/SimplePluginTest.php
+++ b/tests/Sabre/DAVACL/SimplePluginTest.php
@@ -41,12 +41,12 @@ class SimplePluginTest extends \PHPUnit_Framework_TestCase {
         $expected = [
             '{DAV:}all' => [
                 'privilege'  => '{DAV:}all',
-                'abstract'   => true,
+                'abstract'   => false,
                 'aggregates' => [
                     '{DAV:}read',
                     '{DAV:}write',
                 ],
-                'concrete' => null,
+                'concrete' => '{DAV:}all',
             ],
             '{DAV:}read' => [
                 'privilege'  => '{DAV:}read',
@@ -73,21 +73,14 @@ class SimplePluginTest extends \PHPUnit_Framework_TestCase {
                 'privilege'  => '{DAV:}write',
                 'abstract'   => false,
                 'aggregates' => [
-                    '{DAV:}write-acl',
                     '{DAV:}write-properties',
                     '{DAV:}write-content',
+                    '{DAV:}unlock',
                     '{DAV:}bind',
                     '{DAV:}unbind',
-                    '{DAV:}unlock',
                 ],
                 'concrete' => '{DAV:}write',
             ],
-            '{DAV:}write-acl' => [
-                'privilege'  => '{DAV:}write-acl',
-                'abstract'   => false,
-                'aggregates' => [],
-                'concrete'   => '{DAV:}write-acl',
-            ],
             '{DAV:}write-properties' => [
                 'privilege'  => '{DAV:}write-properties',
                 'abstract'   => false,
@@ -264,12 +257,10 @@ class SimplePluginTest extends \PHPUnit_Framework_TestCase {
 
         $expected = [
             '{DAV:}write',
-            '{DAV:}write-acl',
             '{DAV:}write-properties',
             '{DAV:}write-content',
-            '{DAV:}bind',
-            '{DAV:}unbind',
             '{DAV:}unlock',
+            '{DAV:}write-acl',
             '{DAV:}read',
             '{DAV:}read-acl',
             '{DAV:}read-current-user-privilege-set',
diff --git a/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php b/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php
index 07f407c..9a0baa5 100644
--- a/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php
+++ b/tests/Sabre/DAVACL/Xml/Property/SupportedPrivilegeSetTest.php
@@ -23,9 +23,7 @@ class SupportedPrivilegeSetTest extends \PHPUnit_Framework_TestCase {
      */
     function testSerializeSimple() {
 
-        $prop = new SupportedPrivilegeSet([
-            'privilege' => '{DAV:}all',
-        ]);
+        $prop = new SupportedPrivilegeSet([]);
 
         $xml = (new DAV\Server())->xml->write('{DAV:}supported-privilege-set', $prop);
 
@@ -46,17 +44,10 @@ class SupportedPrivilegeSetTest extends \PHPUnit_Framework_TestCase {
     function testSerializeAggregate() {
 
         $prop = new SupportedPrivilegeSet([
-            'privilege'  => '{DAV:}all',
-            'abstract'   => true,
-            'aggregates' => [
-                [
-                    'privilege' => '{DAV:}read',
-                ],
-                [
-                    'privilege'   => '{DAV:}write',
-                    'description' => 'booh',
-                ],
-            ],
+            '{DAV:}read' => [],
+            '{DAV:}write' => [
+                'description' => 'booh',
+            ]
         ]);
 
         $xml = (new DAV\Server())->xml->write('{DAV:}supported-privilege-set', $prop);
@@ -67,7 +58,6 @@ class SupportedPrivilegeSetTest extends \PHPUnit_Framework_TestCase {
   <d:privilege>
    <d:all/>
   </d:privilege>
-  <d:abstract/>
   <d:supported-privilege>
    <d:privilege>
     <d:read/>

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