ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\ITip\BrokerTester Class Reference

Utilities for testing the broker. More...

+ Inheritance diagram for Sabre\VObject\ITip\BrokerTester:
+ Collaboration diagram for Sabre\VObject\ITip\BrokerTester:

Public Member Functions

 parse ($oldMessage, $newMessage, $expected=[], $currentUser='mailto:one @example.org')
 
 process ($input, $existingObject=null, $expected=false)
 

Detailed Description

Utilities for testing the broker.

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 15 of file BrokerTester.php.

Member Function Documentation

◆ parse()

Sabre\VObject\ITip\BrokerTester::parse (   $oldMessage,
  $newMessage,
  $expected = [],
  $currentUser = 'mailto:one@example.org' 
)

Definition at line 19 of file BrokerTester.php.

19 :one@example.org') {
20
21 $broker = new Broker();
22 $result = $broker->parseEvent($newMessage, $currentUser, $oldMessage);
23
24 $this->assertEquals(count($expected), count($result));
25
26 foreach ($expected as $index => $ex) {
27
28 $message = $result[$index];
29
30 foreach ($ex as $key => $val) {
31
32 if ($key === 'message') {
33 $this->assertVObjectEqualsVObject(
34 $val,
35 $message->message->serialize()
36 );
37 } else {
38 $this->assertEquals($val, $message->$key);
39 }
40
41 }
42
43 }
44
45 }

References $index, $key, $message, and $result.

Referenced by Sabre\VObject\ITip\BrokerAttendeeReplyTest\testAccepted(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testAcceptedAllDay(), Sabre\VObject\ITip\BrokerDeleteEventTest\testAttendeeDeleteCancelledEvent(), Sabre\VObject\ITip\BrokerDeleteEventTest\testAttendeeDeleteWithDtend(), Sabre\VObject\ITip\EvolutionTest\testAttendeeModify(), Sabre\VObject\ITip\BrokerDeleteEventTest\testAttendeeReplyWithDuration(), Sabre\VObject\ITip\BrokerNewEventTest\testBrokenEventOrganizerMisMatch(), Sabre\VObject\ITip\BrokerNewEventTest\testBrokenEventUIDMisMatch(), Sabre\VObject\ITip\BrokerNewEventTest\testChangingOrganizers(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testCreateReplyByException(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testCreateReplyByExceptionAllDay(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testCreateReplyByExceptionTz(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testDeclined(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testDeclinedCancelledEvent(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testDontCreateReplyWhenEventWasDeclined(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteChange(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteChangeExdateOrder(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteChangeFromNonSchedulingToSchedulingObject(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteChangeFromSchedulingToNonSchedulingObject(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteChangeSignificantChange(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteNoChange(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteNoChangeForceSend(), Sabre\VObject\ITip\BrokerUpdateEventTest\testInviteRemoveAttendees(), Sabre\VObject\ITip\BrokerNewEventTest\testMultipleUID(), Sabre\VObject\ITip\EvolutionTest\testNewEvolutionEvent(), Sabre\VObject\ITip\BrokerNewEventTest\testNoAttendee(), Sabre\VObject\ITip\BrokerUpdateEventTest\testNoAttendees(), Sabre\VObject\ITip\BrokerDeleteEventTest\testNoCalendar(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testNoChange(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testNoChangeForceSend(), Sabre\VObject\ITip\BrokerNewEventTest\testNoOrganizerHasAttendee(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testNoRelevantAttendee(), Sabre\VObject\ITip\BrokerDeleteEventTest\testOrganizerDeleteWithDtend(), Sabre\VObject\ITip\BrokerDeleteEventTest\testOrganizerDeleteWithDuration(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testPartyCrasher(), Sabre\VObject\ITip\BrokerNewEventTest\testRecurrenceInvite(), Sabre\VObject\ITip\BrokerNewEventTest\testRecurrenceInvite2(), Sabre\VObject\ITip\BrokerNewEventTest\testRecurrenceInvite3(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testRecurringAllDay(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testRecurringReply(), Sabre\VObject\ITip\BrokerUpdateEventTest\testRemoveInstance(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testReplyNoMasterEvent(), Sabre\VObject\ITip\BrokerNewEventTest\testScheduleAgentClient(), Sabre\VObject\ITip\BrokerAttendeeReplyTest\testScheduleAgentOnOrganizer(), Sabre\VObject\ITip\BrokerSignificantChangesTest\testSignificantChangesNoChange(), Sabre\VObject\ITip\BrokerSignificantChangesTest\testSignificantChangesRRuleNoChange(), Sabre\VObject\ITip\BrokerSignificantChangesTest\testSignificantChangesRRuleOrderNoChange(), Sabre\VObject\ITip\BrokerNewEventTest\testSimpleInvite(), Sabre\VObject\ITip\BrokerDeleteEventTest\testVTodo(), and Sabre\VObject\ITip\BrokerNewEventTest\testVTODO().

+ Here is the caller graph for this function:

◆ process()

Sabre\VObject\ITip\BrokerTester::process (   $input,
  $existingObject = null,
  $expected = false 
)

Definition at line 47 of file BrokerTester.php.

47 {
48
50
52
53 foreach ($vcal->getComponents() as $mainComponent) {
54 break;
55 }
56
57 $message = new Message();
58 $message->message = $vcal;
59 $message->method = isset($vcal->METHOD) ? $vcal->METHOD->getValue() : null;
60 $message->component = $mainComponent->name;
61 $message->uid = $mainComponent->UID->getValue();
62 $message->sequence = isset($vcal->VEVENT[0]) ? (string)$vcal->VEVENT[0]->SEQUENCE : null;
63
64 if ($message->method === 'REPLY') {
65
66 $message->sender = $mainComponent->ATTENDEE->getValue();
67 $message->senderName = isset($mainComponent->ATTENDEE['CN']) ? $mainComponent->ATTENDEE['CN']->getValue() : null;
68 $message->recipient = $mainComponent->ORGANIZER->getValue();
69 $message->recipientName = isset($mainComponent->ORGANIZER['CN']) ? $mainComponent->ORGANIZER['CN'] : null;
70
71 }
72
73 $broker = new Broker();
74
75 if (is_string($existingObject)) {
76 $existingObject = str_replace(
77 '%foo%',
78 "VERSION:2.0\nPRODID:-//Sabre//Sabre VObject $version//EN\nCALSCALE:GREGORIAN",
79 $existingObject
80 );
81 $existingObject = Reader::read($existingObject);
82 }
83
84 $result = $broker->processMessage($message, $existingObject);
85
86 if (is_null($expected)) {
87 $this->assertTrue(!$result);
88 return;
89 }
90
91 $this->assertVObjectEqualsVObject(
92 $expected,
94 );
95
96 }
$result
$version
Definition: build.php:27
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
const VERSION
Full version number.
Definition: Version.php:17
catch(Exception $e) $message
foreach( $paths as $path) if(!class_exists( 'Sabre\\VObject\\Version'))
foreach($paths as $path) if($argc< 3) $input

References Sabre\VObject\$input, $message, $result, $vcal, $version, Sabre\VObject\if, Sabre\VObject\Reader\read(), and Sabre\VObject\Version\VERSION.

Referenced by Sabre\VObject\ITip\BrokerProcessMessageTest\testCancel(), Sabre\VObject\ITip\BrokerProcessMessageTest\testCancelNoExistingEvent(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyAccept(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyAcceptUpdateRSVP(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyNewException(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyNewExceptionFirstOccurence(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyNewExceptionNoMasterEvent(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyNewExceptionTz(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyNoOriginal(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyPartyCrashCreateExcepton(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyPartyCrasher(), Sabre\VObject\ITip\BrokerProcessReplyTest\testReplyRequestStatus(), Sabre\VObject\ITip\BrokerProcessMessageTest\testRequestNew(), Sabre\VObject\ITip\BrokerProcessMessageTest\testRequestUpdate(), Sabre\VObject\ITip\BrokerProcessMessageTest\testUnsupportedComponent(), and Sabre\VObject\ITip\BrokerProcessMessageTest\testUnsupportedMethod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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