diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php index f71c19523..735bbef41 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/SharedCalendarTest.php @@ -1,24 +1,26 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV; use Sabre\DAV\Sharing; use Sabre\DAV\Xml\Element\Sharee; -class SharedCalendarTest extends \PHPUnit_Framework_TestCase { - +class SharedCalendarTest extends \PHPUnit\Framework\TestCase +{ protected $backend; - function getInstance(array $props = null) { - + public function getInstance(array $props = null) + { if (is_null($props)) { $props = [ - 'id' => 1, + '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' => false, - 'share-access' => Sharing\Plugin::ACCESS_READWRITE, - 'principaluri' => 'principals/sharee', + '{http://sabredav.org/ns}owner-principal' => 'principals/owner', + '{http://sabredav.org/ns}read-only' => false, + 'share-access' => Sharing\Plugin::ACCESS_READWRITE, + 'principaluri' => 'principals/sharee', ]; } @@ -35,11 +37,10 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase { $this->backend->updateInvites(1, [$sharee]); return new SharedCalendar($this->backend, $props); - } - function testGetInvites() { - + public function testGetInvites() + { $sharee = new Sharee(); $sharee->href = 'mailto:removeme@example.org'; $sharee->properties['{DAV:}displayname'] = 'To be removed'; @@ -50,15 +51,15 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase { [$sharee], $this->getInstance()->getInvites() ); - } - function testGetOwner() { + public function testGetOwner() + { $this->assertEquals('principals/sharee', $this->getInstance()->getOwner()); } - function testGetACL() { - + public function testGetACL() + { $expected = [ [ 'privilege' => '{DAV:}write', @@ -96,18 +97,17 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase { 'protected' => true, ], [ - 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy', + 'privilege' => '{'.Plugin::NS_CALDAV.'}read-free-busy', 'principal' => '{DAV:}authenticated', 'protected' => true, ], ]; $this->assertEquals($expected, $this->getInstance()->getACL()); - } - function testGetChildACL() { - + public function testGetChildACL() + { $expected = [ [ 'privilege' => '{DAV:}write', @@ -134,19 +134,17 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase { 'principal' => 'principals/sharee/calendar-proxy-read', 'protected' => true, ], - ]; $this->assertEquals($expected, $this->getInstance()->getChildACL()); - } - function testUpdateInvites() { - + public function testUpdateInvites() + { $instance = $this->getInstance(); $newSharees = [ new Sharee(), - new Sharee() + new Sharee(), ]; $newSharees[0]->href = 'mailto:test@example.org'; $newSharees[0]->properties['{DAV:}displayname'] = 'Foo Bar'; @@ -159,18 +157,16 @@ class SharedCalendarTest extends \PHPUnit_Framework_TestCase { $instance->updateInvites($newSharees); $expected = [ - clone $newSharees[0] + clone $newSharees[0], ]; $expected[0]->inviteStatus = Sharing\Plugin::INVITE_NORESPONSE; $this->assertEquals($expected, $instance->getInvites()); - } - function testPublish() { - + public function testPublish() + { $instance = $this->getInstance(); $this->assertNull($instance->setPublishStatus(true)); $this->assertNull($instance->setPublishStatus(false)); - } } |