diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php index 9a3d47828..49252744d 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php @@ -1,29 +1,31 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV; use Sabre\HTTP; use Sabre\VObject; /** - * This unittests is created to find out why recurring events have wrong DTSTART value + * This unittests is created to find out why recurring events have wrong DTSTART value. * * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ExpandEventsDTSTARTandDTENDTest extends \Sabre\DAVServerTest { - +class ExpandEventsDTSTARTandDTENDTest extends \Sabre\DAVServerTest +{ protected $setupCalDAV = true; protected $caldavCalendars = [ [ - 'id' => 1, - 'name' => 'Calendar', + 'id' => 1, + 'name' => 'Calendar', 'principaluri' => 'principals/user1', - 'uri' => 'calendar1', - ] + 'uri' => 'calendar1', + ], ]; protected $caldavCalendarObjects = [ @@ -52,13 +54,13 @@ END:VCALENDAR ], ]; - function testExpand() { - + public function testExpand() + { $request = HTTP\Sapi::createFromServerArray([ - 'REQUEST_METHOD' => 'REPORT', + 'REQUEST_METHOD' => 'REPORT', 'HTTP_CONTENT_TYPE' => 'application/xml', - 'REQUEST_URI' => '/calendars/user1/calendar1', - 'HTTP_DEPTH' => '1', + 'REQUEST_URI' => '/calendars/user1/calendar1', + 'HTTP_DEPTH' => '1', ]); $request->setBody('<?xml version="1.0" encoding="utf-8" ?> @@ -91,7 +93,7 @@ END:VCALENDAR try { $vObject = VObject\Reader::read($body); } catch (VObject\ParseException $e) { - $this->fail('Could not parse object. Error:' . $e->getMessage() . ' full object: ' . $response->getBodyAsString()); + $this->fail('Could not parse object. Error:'.$e->getMessage().' full object: '.$response->getBodyAsString()); } // check if DTSTARTs and DTENDs are correct @@ -99,15 +101,14 @@ END:VCALENDAR /** @var $vevent Sabre\VObject\Component\VEvent */ foreach ($vevent->children() as $child) { /** @var $child Sabre\VObject\Property */ - if ($child->name == 'DTSTART') { + if ('DTSTART' == $child->name) { // DTSTART has to be one of three valid values - $this->assertContains($child->getValue(), ['20120207T171500Z', '20120208T171500Z', '20120209T171500Z'], 'DTSTART is not a valid value: ' . $child->getValue()); - } elseif ($child->name == 'DTEND') { + $this->assertContains($child->getValue(), ['20120207T171500Z', '20120208T171500Z', '20120209T171500Z'], 'DTSTART is not a valid value: '.$child->getValue()); + } elseif ('DTEND' == $child->name) { // DTEND has to be one of three valid values - $this->assertContains($child->getValue(), ['20120207T181500Z', '20120208T181500Z', '20120209T181500Z'], 'DTEND is not a valid value: ' . $child->getValue()); + $this->assertContains($child->getValue(), ['20120207T181500Z', '20120208T181500Z', '20120209T181500Z'], 'DTEND is not a valid value: '.$child->getValue()); } } } } - } |