From 0b02a6d123b2014705998c94ddf3d460948d3eac Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 10 May 2016 17:26:44 -0700 Subject: initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import) --- .../ExpandEventsDTSTARTandDTENDbyDayTest.php | 49 +++++++++++----------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php index 3793cadc7..efc49673f 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php @@ -1,13 +1,14 @@ 1, - 'name' => 'Calendar', + protected $caldavCalendars = [ + [ + 'id' => 1, + 'name' => 'Calendar', 'principaluri' => 'principals/user1', - 'uri' => 'calendar1', - ) - ); + 'uri' => 'calendar1', + ] + ]; - protected $caldavCalendarObjects = array( - 1 => array( - 'event.ics' => array( + protected $caldavCalendarObjects = [ + 1 => [ + 'event.ics' => [ 'calendardata' => 'BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT @@ -38,18 +39,18 @@ DTSTART;TZID=Europe/Berlin:20120207T181500 END:VEVENT END:VCALENDAR ', - ), - ), - ); + ], + ], + ]; function testExpandRecurringByDayEvent() { - $request = new HTTP\Request(array( - 'REQUEST_METHOD' => 'REPORT', + $request = HTTP\Sapi::createFromServerArray([ + '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(' @@ -76,7 +77,7 @@ END:VCALENDAR $start = strpos($response->body, 'BEGIN:VCALENDAR'), strpos($response->body, 'END:VCALENDAR') - $start + 13 ); - $body = str_replace(' ','',$body); + $body = str_replace(' ', '', $body); $vObject = VObject\Reader::read($body); @@ -85,19 +86,17 @@ END:VCALENDAR // check if DTSTARTs and DTENDs are correct foreach ($vObject->VEVENT as $vevent) { /** @var $vevent Sabre\VObject\Component\VEvent */ - foreach ($vevent->children as $child) { + foreach ($vevent->children() as $child) { /** @var $child Sabre\VObject\Property */ - if ($child->name == 'DTSTART') { // DTSTART has to be one of two valid values - $this->assertContains($child->getValue(), array('20120214T171500Z', '20120216T171500Z'), 'DTSTART is not a valid value: '.$child->getValue()); + $this->assertContains($child->getValue(), ['20120214T171500Z', '20120216T171500Z'], 'DTSTART is not a valid value: ' . $child->getValue()); } elseif ($child->name == 'DTEND') { // DTEND has to be one of two valid values - $this->assertContains($child->getValue(), array('20120214T181500Z', '20120216T181500Z'), 'DTEND is not a valid value: '.$child->getValue()); + $this->assertContains($child->getValue(), ['20120214T181500Z', '20120216T181500Z'], 'DTEND is not a valid value: ' . $child->getValue()); } } } } } - -- cgit v1.2.3