17 use \Sabre\VObject\PHPUnitAssertions;
19 function parse($oldMessage, $newMessage, $expected = [], $currentUser =
'mailto:one@example.org') {
22 $result = $broker->parseEvent($newMessage, $currentUser, $oldMessage);
24 $this->assertEquals(count($expected), count(
$result));
26 foreach ($expected as
$index => $ex) {
30 foreach ($ex as
$key => $val) {
32 if (
$key ===
'message') {
33 $this->assertVObjectEqualsVObject(
38 $this->assertEquals($val,
$message->$key);
53 foreach (
$vcal->getComponents() as $mainComponent) {
60 $message->component = $mainComponent->name;
61 $message->uid = $mainComponent->UID->getValue();
62 $message->sequence = isset(
$vcal->VEVENT[0]) ? (string)
$vcal->VEVENT[0]->SEQUENCE : null;
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;
75 if (is_string($existingObject)) {
76 $existingObject = str_replace(
78 "VERSION:2.0\nPRODID:-//Sabre//Sabre VObject $version//EN\nCALSCALE:GREGORIAN",
86 if (is_null($expected)) {
91 $this->assertVObjectEqualsVObject(
The ITip class is a utility class that helps with processing so-called iTip messages.
foreach($paths as $path) if(!class_exists( 'Sabre\\VObject\\Version'))
const VERSION
Full version number.
This class represents an iTip message.
process($input, $existingObject=null, $expected=false)
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
parse($oldMessage, $newMessage, $expected=[], $currentUser='mailto:one @example.org')
Utilities for testing the broker.