aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php91
1 files changed, 86 insertions, 5 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php
index 955831917..337b658f4 100644
--- a/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php
@@ -20,7 +20,7 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase {
);
}
- $this->backend = new Backend\Mock(
+ $this->backend = new Backend\MockSharing(
array($props),
array(),
array()
@@ -64,18 +64,58 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase {
'principal' => 'principals/owner',
'protected' => true,
),
+
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/owner/calendar-proxy-write',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/owner/calendar-proxy-read',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy',
+ 'principal' => '{DAV:}authenticated',
+ 'protected' => true,
+ ),
array(
'privilege' => '{DAV:}write',
'principal' => 'principals/owner',
'protected' => true,
),
array(
- 'privilege' => '{DAV:}read',
+ 'privilege' => '{DAV:}write',
'principal' => 'principals/owner/calendar-proxy-write',
'protected' => true,
),
array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/sharee',
+ 'protected' => true,
+ ),
+ array(
'privilege' => '{DAV:}write',
+ 'principal' => 'principals/sharee',
+ 'protected' => true,
+ ),
+ );
+
+ $this->assertEquals($expected, $this->getInstance()->getACL());
+
+ }
+
+ function testGetChildACL() {
+
+ $expected = array(
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/owner',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}read',
'principal' => 'principals/owner/calendar-proxy-write',
'protected' => true,
),
@@ -85,8 +125,13 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase {
'protected' => true,
),
array(
- 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy',
- 'principal' => '{DAV:}authenticated',
+ 'privilege' => '{DAV:}write',
+ 'principal' => 'principals/owner',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}write',
+ 'principal' => 'principals/owner/calendar-proxy-write',
'protected' => true,
),
array(
@@ -101,7 +146,43 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase {
),
);
- $this->assertEquals($expected, $this->getInstance()->getACL());
+ $this->assertEquals($expected, $this->getInstance()->getChildACL());
+
+ }
+
+ function testGetChildACLReadOnly() {
+
+ $expected = array(
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/owner',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/owner/calendar-proxy-write',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/owner/calendar-proxy-read',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/sharee',
+ 'protected' => true,
+ ),
+ );
+
+ $props = array(
+ 'id' => 1,
+ '{http://calendarserver.org/ns/}shared-url' => 'calendars/owner/original',
+ '{http://sabredav.org/ns}owner-principal' => 'principals/owner',
+ '{http://sabredav.org/ns}read-only' => true,
+ 'principaluri' => 'principals/sharee',
+ );
+ $this->assertEquals($expected, $this->getInstance($props)->getChildACL());
}