"Fossies" - the Fresh Open Source Software Archive

Member "dav-4.0.3/tests/Sabre/CalDAV/Issue211Test.php" (10 Jan 2020, 2392 Bytes) of package /linux/www/dav-4.0.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Issue211Test.php": 4.0.2_vs_4.0.3.

    1 <?php
    2 
    3 declare(strict_types=1);
    4 
    5 namespace Sabre\CalDAV;
    6 
    7 use Sabre\HTTP;
    8 
    9 /**
   10  * This unittest is created to check for an endless loop in Sabre\CalDAV\CalendarQueryValidator.
   11  *
   12  * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
   13  * @author Evert Pot (http://evertpot.com/)
   14  * @license http://sabre.io/license/ Modified BSD License
   15  */
   16 class Issue211Test extends \Sabre\DAVServerTest
   17 {
   18     protected $setupCalDAV = true;
   19 
   20     protected $caldavCalendars = [
   21         [
   22             'id' => 1,
   23             'name' => 'Calendar',
   24             'principaluri' => 'principals/user1',
   25             'uri' => 'calendar1',
   26         ],
   27     ];
   28 
   29     protected $caldavCalendarObjects = [
   30         1 => [
   31             'event.ics' => [
   32                 'calendardata' => 'BEGIN:VCALENDAR
   33 VERSION:2.0
   34 BEGIN:VEVENT
   35 UID:20120418T172519CEST-3510gh1hVw
   36 DTSTAMP:20120418T152519Z
   37 DTSTART;VALUE=DATE:20120330
   38 DTEND;VALUE=DATE:20120531
   39 EXDATE;TZID=Europe/Berlin:20120330T000000
   40 RRULE:FREQ=YEARLY;INTERVAL=1
   41 SEQUENCE:1
   42 SUMMARY:Birthday
   43 TRANSP:TRANSPARENT
   44 BEGIN:VALARM
   45 ACTION:EMAIL
   46 ATTENDEE:MAILTO:xxx@domain.de
   47 DESCRIPTION:Dies ist eine Kalender Erinnerung
   48 SUMMARY:Kalender Alarm Erinnerung
   49 TRIGGER;VALUE=DATE-TIME:20120329T060000Z
   50 END:VALARM
   51 END:VEVENT
   52 END:VCALENDAR
   53 ',
   54             ],
   55         ],
   56     ];
   57 
   58     public function testIssue211()
   59     {
   60         $request = HTTP\Sapi::createFromServerArray([
   61             'REQUEST_METHOD' => 'REPORT',
   62             'HTTP_CONTENT_TYPE' => 'application/xml',
   63             'REQUEST_URI' => '/calendars/user1/calendar1',
   64             'HTTP_DEPTH' => '1',
   65         ]);
   66 
   67         $request->setBody('<?xml version="1.0" encoding="utf-8" ?>
   68 <C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
   69     <D:prop>
   70         <C:calendar-data/>
   71         <D:getetag/>
   72     </D:prop>
   73     <C:filter>
   74         <C:comp-filter name="VCALENDAR">
   75             <C:comp-filter name="VEVENT">
   76                 <C:comp-filter name="VALARM">
   77                     <C:time-range start="20120426T220000Z" end="20120427T215959Z"/>
   78                 </C:comp-filter>
   79             </C:comp-filter>
   80         </C:comp-filter>
   81     </C:filter>
   82 </C:calendar-query>');
   83 
   84         $response = $this->request($request);
   85 
   86         // if this assert is reached, the endless loop is gone
   87         // There should be no matching events
   88         $this->assertFalse(strpos('BEGIN:VEVENT', $response->getBodyAsString()));
   89     }
   90 }