From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../dav/tests/Sabre/CalDAV/FreeBusyReportTest.php | 82 ++++++++++------------ 1 file changed, 36 insertions(+), 46 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php index 7604c7f4c..3d4b36313 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/FreeBusyReportTest.php @@ -1,15 +1,14 @@ [ 'obj1' => [ - 'calendarid' => 1, - 'uri' => 'event1.ics', + 'calendarid' => 1, + 'uri' => 'event1.ics', 'calendardata' => $obj1, ], 'obj2' => [ - 'calendarid' => 1, - 'uri' => 'event2.ics', - 'calendardata' => $obj2 + 'calendarid' => 1, + 'uri' => 'event2.ics', + 'calendardata' => $obj2, ], 'obj3' => [ - 'calendarid' => 1, - 'uri' => 'event3.ics', - 'calendardata' => $obj3 - ] + 'calendarid' => 1, + 'uri' => 'event3.ics', + 'calendardata' => $obj3, + ], ], ]; - $caldavBackend = new Backend\Mock([], $calendarData); $calendar = new Calendar($caldavBackend, [ - 'id' => 1, - 'uri' => 'calendar', - 'principaluri' => 'principals/user1', - '{' . Plugin::NS_CALDAV . '}calendar-timezone' => "BEGIN:VCALENDAR\r\nBEGIN:VTIMEZONE\r\nTZID:Europe/Berlin\r\nEND:VTIMEZONE\r\nEND:VCALENDAR", + 'id' => 1, + 'uri' => 'calendar', + 'principaluri' => 'principals/user1', + '{'.Plugin::NS_CALDAV.'}calendar-timezone' => "BEGIN:VCALENDAR\r\nBEGIN:VTIMEZONE\r\nTZID:Europe/Berlin\r\nEND:VTIMEZONE\r\nEND:VCALENDAR", ]); $this->server = new DAV\Server([$calendar]); - $request = HTTP\Sapi::createFromServerArray([ - 'REQUEST_URI' => '/calendar', - ]); + $request = new HTTP\Request('GET', '/calendar'); $this->server->httpRequest = $request; $this->server->httpResponse = new HTTP\ResponseMock(); $this->plugin = new Plugin(); $this->server->addPlugin($this->plugin); - } - function testFreeBusyReport() { - + public function testFreeBusyReport() + { $reportXML = << @@ -108,17 +103,16 @@ XML; $this->assertEquals(200, $this->server->httpResponse->status); $this->assertEquals('text/calendar', $this->server->httpResponse->getHeader('Content-Type')); - $this->assertTrue(strpos($this->server->httpResponse->body, 'BEGIN:VFREEBUSY') !== false); - $this->assertTrue(strpos($this->server->httpResponse->body, '20111005T120000Z/20111005T130000Z') !== false); - $this->assertTrue(strpos($this->server->httpResponse->body, '20111006T100000Z/20111006T110000Z') !== false); - + $this->assertTrue(false !== strpos($this->server->httpResponse->body, 'BEGIN:VFREEBUSY')); + $this->assertTrue(false !== strpos($this->server->httpResponse->body, '20111005T120000Z/20111005T130000Z')); + $this->assertTrue(false !== strpos($this->server->httpResponse->body, '20111006T100000Z/20111006T110000Z')); } /** - * @expectedException Sabre\DAV\Exception\BadRequest + * @expectedException \Sabre\DAV\Exception\BadRequest */ - function testFreeBusyReportNoTimeRange() { - + public function testFreeBusyReportNoTimeRange() + { $reportXML = << @@ -126,17 +120,14 @@ XML; XML; $report = $this->server->xml->parse($reportXML, null, $rootElem); - } /** - * @expectedException Sabre\DAV\Exception\NotImplemented + * @expectedException \Sabre\DAV\Exception\NotImplemented */ - function testFreeBusyReportWrongNode() { - - $request = HTTP\Sapi::createFromServerArray([ - 'REQUEST_URI' => '/', - ]); + public function testFreeBusyReportWrongNode() + { + $request = new HTTP\Request('REPORT', '/'); $this->server->httpRequest = $request; $reportXML = <<server->xml->parse($reportXML, null, $rootElem); $this->plugin->report($rootElem, $report, null); - } /** - * @expectedException Sabre\DAV\Exception + * @expectedException \Sabre\DAV\Exception */ - function testFreeBusyReportNoACLPlugin() { - + public function testFreeBusyReportNoACLPlugin() + { $this->server = new DAV\Server(); + $this->server->httpRequest = new HTTP\Request('REPORT', '/'); $this->plugin = new Plugin(); $this->server->addPlugin($this->plugin); @@ -169,6 +160,5 @@ XML; $report = $this->server->xml->parse($reportXML, null, $rootElem); $this->plugin->report($rootElem, $report, null); - } } -- cgit v1.2.3