parse($message); } function testVTODO() { $message = <<parse($message); } function testSimpleInvite() { $message = << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:white@example.org', 'recipientName' => 'White', 'message' => $expectedMessage, ), ); $result = $this->parse($message, $expected); } /** * @expectedException \Sabre\VObject\ITip\ITipException */ function testBrokenEventUIDMisMatch() { $message = <<parse($message, array()); } /** * @expectedException \Sabre\VObject\ITip\ITipException */ function testBrokenEventOrganizerMisMatch() { $message = <<parse($message, array()); } function testRecurrenceInvite() { $message = << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:one@example.org', 'recipientName' => 'One', 'message' => << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:two@example.org', 'recipientName' => 'Two', 'message' => << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:three@example.org', 'recipientName' => 'Three', 'message' => <<parse($message, $expected); } function testRecurrenceInvite2() { // This method tests a nearly identical path, but in this case the // master event does not have an EXDATE. $message = << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:one@example.org', 'recipientName' => 'One', 'message' => << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:two@example.org', 'recipientName' => 'Two', 'message' => << 'foobar', 'method' => 'REQUEST', 'component' => 'VEVENT', 'sender' => 'mailto:strunk@example.org', 'senderName' => 'Strunk', 'recipient' => 'mailto:three@example.org', 'recipientName' => 'Three', 'message' => <<parse($message, $expected); } function testScheduleAgentClient() { $message = <<parse($message, $expected); } /** * @expectedException Sabre\VObject\ITip\ITipException */ function testMultipleUID() { $message = <<parse($message, array()); } /** * @expectedException Sabre\VObject\ITip\SameOrganizerForAllComponentsException * */ function testChangingOrganizers() { $message = <<parse($message, array()); } function testNoOrganizerHasAttendee() { $message = <<parse($message, array()); } function parse($message, $expected = array()) { $broker = new Broker(); $result = $broker->parseEvent($message, 'mailto:strunk@example.org'); $this->assertEquals(count($expected), count($result)); foreach($expected as $index=>$ex) { $message = $result[$index]; foreach($ex as $key=>$val) { if ($key==='message') { $this->assertEquals( str_replace("\n", "\r\n", $val), rtrim($message->message->serialize(), "\r\n") ); } else { $this->assertEquals($val, $message->$key); } } } } }