diff options
author | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
commit | 0b02a6d123b2014705998c94ddf3d460948d3eac (patch) | |
tree | 78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php | |
parent | 40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff) | |
download | volse-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/CalendarObjectTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php index eab10eae7..9fc1eee4c 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarObjectTest.php @@ -43,7 +43,7 @@ class CalendarObjectTest extends \PHPUnit_Framework_TestCase { $this->assertInternalType('string',$children[0]->getName()); $this->assertInternalType('string',$children[0]->get()); $this->assertInternalType('string',$children[0]->getETag()); - $this->assertEquals('text/calendar; charset=utf-8', $children[0]->getContentType()); + $this->assertEquals('text/calendar; charset=utf-8; component=vevent', $children[0]->getContentType()); } @@ -180,6 +180,46 @@ class CalendarObjectTest extends \PHPUnit_Framework_TestCase { 'protected' => true, ), array( + 'privilege' => '{DAV:}read', + 'principal' => 'principals/user1/calendar-proxy-write', + 'protected' => true, + ), + array( + 'privilege' => '{DAV:}read', + 'principal' => 'principals/user1/calendar-proxy-read', + 'protected' => true, + ), + array( + 'privilege' => '{DAV:}write', + 'principal' => 'principals/user1', + 'protected' => true, + ), + array( + 'privilege' => '{DAV:}write', + 'principal' => 'principals/user1/calendar-proxy-write', + 'protected' => true, + ), + ); + + $children = $this->calendar->getChildren(); + $this->assertTrue($children[0] instanceof CalendarObject); + + $obj = $children[0]; + $this->assertEquals($expected, $obj->getACL()); + + } + + function testDefaultACL() { + + $backend = new Backend\Mock([], []); + $calendarObject = new CalendarObject($backend, ['principaluri' => 'principals/user1'], ['calendarid' => 1, 'uri' => 'foo']); + $expected = array( + array( + 'privilege' => '{DAV:}read', + 'principal' => 'principals/user1', + 'protected' => true, + ), + array( 'privilege' => '{DAV:}write', 'principal' => 'principals/user1', 'protected' => true, @@ -200,12 +240,8 @@ class CalendarObjectTest extends \PHPUnit_Framework_TestCase { 'protected' => true, ), ); + $this->assertEquals($expected, $calendarObject->getACL()); - $children = $this->calendar->getChildren(); - $this->assertTrue($children[0] instanceof CalendarObject); - - $obj = $children[0]; - $this->assertEquals($expected, $obj->getACL()); } @@ -278,7 +314,7 @@ END:VCALENDAR"; ), ) )); - $obj = new CalendarObject($backend, array(), array('calendarid' => 1, 'uri' => 'foo')); + $obj = new CalendarObject($backend, array('id' => 1), array('uri' => 'foo')); $this->assertEquals('foo', $obj->get()); |