ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Schedule\DeliverNewEventTest Class Reference
+ Inheritance diagram for Sabre\CalDAV\Schedule\DeliverNewEventTest:
+ Collaboration diagram for Sabre\CalDAV\Schedule\DeliverNewEventTest:

Public Member Functions

 setUp ()
 
 testDelivery ()
 
- Public Member Functions inherited from Sabre\DAVServerTest
 setUp ()
 
 initializeEverything ()
 
 request ($request, $expectedStatus=null)
 Makes a request, and returns a response object. More...
 
 autoLogin ($userName)
 This function takes a username and sets the server in a state where this user is logged in, and no longer requires an authentication check. More...
 
 setUpTree ()
 Override this to provide your own Tree for your test-case. More...
 
 setUpBackends ()
 
 assertHttpStatus ($expectedStatus, HTTP\Request $req)
 

Data Fields

 $setupCalDAV = true
 
 $setupCalDAVScheduling = true
 
 $setupACL = true
 
 $autoLogin = 'user1'
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\DAVServerTest
 $setupCalDAV = false
 
 $setupCardDAV = false
 
 $setupACL = false
 
 $setupCalDAVSharing = false
 
 $setupCalDAVScheduling = false
 
 $setupCalDAVSubscriptions = false
 
 $setupCalDAVICSExport = false
 
 $setupLocks = false
 
 $setupFiles = false
 
 $setupSharing = false
 
 $setupPropertyStorage = false
 
 $caldavCalendars = []
 An array with calendars. More...
 
 $caldavCalendarObjects = []
 
 $carddavAddressBooks = []
 
 $carddavCards = []
 
 $server
 
 $tree = []
 
 $caldavBackend
 
 $carddavBackend
 
 $principalBackend
 
 $locksBackend
 
 $propertyStorageBackend
 
 $caldavPlugin
 
 $carddavPlugin
 
 $aclPlugin
 
 $caldavSharingPlugin
 
 $caldavSchedulePlugin
 
 $authPlugin
 
 $locksPlugin
 
 $sharingPlugin
 
 $propertyStoragePlugin
 
 $autoLogin = null
 If this string is set, we will automatically log in the user with this name. More...
 

Detailed Description

Definition at line 8 of file DeliverNewEventTest.php.

Member Function Documentation

◆ setUp()

Sabre\CalDAV\Schedule\DeliverNewEventTest::setUp ( )

Definition at line 15 of file DeliverNewEventTest.php.

15  {
16 
17  parent::setUp();
18  $this->caldavBackend->createCalendar(
19  'principals/user1',
20  'default',
21  [
22 
23  ]
24  );
25  $this->caldavBackend->createCalendar(
26  'principals/user2',
27  'default',
28  [
29 
30  ]
31  );
32 
33  }

◆ testDelivery()

Sabre\CalDAV\Schedule\DeliverNewEventTest::testDelivery ( )

Definition at line 35 of file DeliverNewEventTest.php.

References $message, $messages, $request, $response, $result, Sabre\VObject\Reader\read(), Sabre\DAVServerTest\request(), and user2.

35  {
36 
37  $request = new Request('PUT', '/calendars/user1/default/foo.ics');
38  $request->setBody(<<<ICS
39 BEGIN:VCALENDAR
40 VERSION:2.0
41 PRODID:-//Apple Inc.//Mac OS X 10.9.1//EN
42 CALSCALE:GREGORIAN
43 BEGIN:VEVENT
44 CREATED:20140109T204404Z
45 UID:AADC6438-18CF-4B52-8DD2-EF9AD75ADE83
46 DTEND;TZID=America/Toronto:20140107T110000
47 TRANSP:OPAQUE
48 ATTENDEE;CN="Administrator";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:mailto:user1.sabredav@sabredav.org
49 ATTENDEE;CN="Roxy Kesh";CUTYPE=INDIVIDUAL;EMAIL="user2.sabredav@sabrdav.org";
50  PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:user2.sabredav@sabredav.org
51 SUMMARY:Just testing!
52 DTSTART;TZID=America/Toronto:20140107T100000
53 DTSTAMP:20140109T204422Z
54 ORGANIZER;CN="Administrator":mailto:user1.sabredav@sabredav.org
55 SEQUENCE:4
56 END:VEVENT
57 END:VCALENDAR
58 ICS
59  );
60 
61  $messages = [];
62  $this->server->on('schedule', function($message) use (&$messages) {
63  $messages[] = $message;
64  });
65 
66  $response = $this->request($request);
67 
68  $this->assertEquals(201, $response->getStatus(), 'Incorrect status code received. Response body:' . $response->getBodyAsString());
69 
70  $result = $this->request(new Request('GET', '/calendars/user1/default/foo.ics'))->getBody();
71  $resultVObj = VObject\Reader::read($result);
72 
73  $this->assertEquals(
74  '1.2',
75  $resultVObj->VEVENT->ATTENDEE[1]['SCHEDULE-STATUS']->getValue()
76  );
77 
78  $this->assertEquals(1, count($messages));
79  $message = $messages[0];
80 
81  $this->assertInstanceOf('\Sabre\VObject\ITip\Message', $message);
82  $this->assertEquals('mailto:user2.sabredav@sabredav.org', $message->recipient);
83  $this->assertEquals('Roxy Kesh', $message->recipientName);
84  $this->assertEquals('mailto:user1.sabredav@sabredav.org', $message->sender);
85  $this->assertEquals('Administrator', $message->senderName);
86  $this->assertEquals('REQUEST', $message->method);
87 
88  $this->assertEquals('REQUEST', $message->message->METHOD->getValue());
89 
90  }
$result
foreach($paths as $path) $request
Definition: asyncclient.php:32
$messages
Definition: en.php:5
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response
user2
Definition: basicauth.php:12
+ Here is the call graph for this function:

Field Documentation

◆ $autoLogin

Sabre\CalDAV\Schedule\DeliverNewEventTest::$autoLogin = 'user1'

Definition at line 13 of file DeliverNewEventTest.php.

◆ $setupACL

Sabre\CalDAV\Schedule\DeliverNewEventTest::$setupACL = true

Definition at line 12 of file DeliverNewEventTest.php.

◆ $setupCalDAV

Sabre\CalDAV\Schedule\DeliverNewEventTest::$setupCalDAV = true

Definition at line 10 of file DeliverNewEventTest.php.

◆ $setupCalDAVScheduling

Sabre\CalDAV\Schedule\DeliverNewEventTest::$setupCalDAVScheduling = true

Definition at line 11 of file DeliverNewEventTest.php.


The documentation for this class was generated from the following file: