1*a1a3b679SAndreas Boehler<?php 2*a1a3b679SAndreas Boehler 3*a1a3b679SAndreas Boehlernamespace Sabre\VObject\ITip; 4*a1a3b679SAndreas Boehler 5*a1a3b679SAndreas Boehlerclass BrokerDeleteEventTest extends BrokerTester { 6*a1a3b679SAndreas Boehler 7*a1a3b679SAndreas Boehler function testOrganizerDelete() { 8*a1a3b679SAndreas Boehler 9*a1a3b679SAndreas Boehler $oldMessage = <<<ICS 10*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 11*a1a3b679SAndreas BoehlerVERSION:2.0 12*a1a3b679SAndreas BoehlerBEGIN:VEVENT 13*a1a3b679SAndreas BoehlerUID:foobar 14*a1a3b679SAndreas BoehlerSEQUENCE:1 15*a1a3b679SAndreas BoehlerSUMMARY:foo 16*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org 17*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org 18*a1a3b679SAndreas BoehlerATTENDEE;CN=Two:mailto:two@example.org 19*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z 20*a1a3b679SAndreas BoehlerEND:VEVENT 21*a1a3b679SAndreas BoehlerEND:VCALENDAR 22*a1a3b679SAndreas BoehlerICS; 23*a1a3b679SAndreas Boehler 24*a1a3b679SAndreas Boehler 25*a1a3b679SAndreas Boehler $newMessage = null; 26*a1a3b679SAndreas Boehler 27*a1a3b679SAndreas Boehler $version = \Sabre\VObject\Version::VERSION; 28*a1a3b679SAndreas Boehler 29*a1a3b679SAndreas Boehler $expected = array( 30*a1a3b679SAndreas Boehler array( 31*a1a3b679SAndreas Boehler 'uid' => 'foobar', 32*a1a3b679SAndreas Boehler 'method' => 'CANCEL', 33*a1a3b679SAndreas Boehler 'component' => 'VEVENT', 34*a1a3b679SAndreas Boehler 'sender' => 'mailto:strunk@example.org', 35*a1a3b679SAndreas Boehler 'senderName' => 'Strunk', 36*a1a3b679SAndreas Boehler 'recipient' => 'mailto:one@example.org', 37*a1a3b679SAndreas Boehler 'recipientName' => 'One', 38*a1a3b679SAndreas Boehler 'message' => <<<ICS 39*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 40*a1a3b679SAndreas BoehlerVERSION:2.0 41*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN 42*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN 43*a1a3b679SAndreas BoehlerMETHOD:CANCEL 44*a1a3b679SAndreas BoehlerBEGIN:VEVENT 45*a1a3b679SAndreas BoehlerUID:foobar 46*a1a3b679SAndreas BoehlerSEQUENCE:2 47*a1a3b679SAndreas BoehlerSUMMARY:foo 48*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z 49*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org 50*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org 51*a1a3b679SAndreas BoehlerEND:VEVENT 52*a1a3b679SAndreas BoehlerEND:VCALENDAR 53*a1a3b679SAndreas BoehlerICS 54*a1a3b679SAndreas Boehler ), 55*a1a3b679SAndreas Boehler 56*a1a3b679SAndreas Boehler array( 57*a1a3b679SAndreas Boehler 'uid' => 'foobar', 58*a1a3b679SAndreas Boehler 'method' => 'CANCEL', 59*a1a3b679SAndreas Boehler 'component' => 'VEVENT', 60*a1a3b679SAndreas Boehler 'sender' => 'mailto:strunk@example.org', 61*a1a3b679SAndreas Boehler 'senderName' => 'Strunk', 62*a1a3b679SAndreas Boehler 'recipient' => 'mailto:two@example.org', 63*a1a3b679SAndreas Boehler 'recipientName' => 'Two', 64*a1a3b679SAndreas Boehler 'message' => <<<ICS 65*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 66*a1a3b679SAndreas BoehlerVERSION:2.0 67*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN 68*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN 69*a1a3b679SAndreas BoehlerMETHOD:CANCEL 70*a1a3b679SAndreas BoehlerBEGIN:VEVENT 71*a1a3b679SAndreas BoehlerUID:foobar 72*a1a3b679SAndreas BoehlerSEQUENCE:2 73*a1a3b679SAndreas BoehlerSUMMARY:foo 74*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z 75*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org 76*a1a3b679SAndreas BoehlerATTENDEE;CN=Two:mailto:two@example.org 77*a1a3b679SAndreas BoehlerEND:VEVENT 78*a1a3b679SAndreas BoehlerEND:VCALENDAR 79*a1a3b679SAndreas BoehlerICS 80*a1a3b679SAndreas Boehler 81*a1a3b679SAndreas Boehler ), 82*a1a3b679SAndreas Boehler ); 83*a1a3b679SAndreas Boehler 84*a1a3b679SAndreas Boehler $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org'); 85*a1a3b679SAndreas Boehler 86*a1a3b679SAndreas Boehler } 87*a1a3b679SAndreas Boehler 88*a1a3b679SAndreas Boehler function testAttendeeDelete() { 89*a1a3b679SAndreas Boehler 90*a1a3b679SAndreas Boehler $oldMessage = <<<ICS 91*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 92*a1a3b679SAndreas BoehlerVERSION:2.0 93*a1a3b679SAndreas BoehlerBEGIN:VEVENT 94*a1a3b679SAndreas BoehlerUID:foobar 95*a1a3b679SAndreas BoehlerSEQUENCE:1 96*a1a3b679SAndreas BoehlerSUMMARY:foo 97*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org 98*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org 99*a1a3b679SAndreas BoehlerATTENDEE;CN=Two:mailto:two@example.org 100*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z 101*a1a3b679SAndreas BoehlerEND:VEVENT 102*a1a3b679SAndreas BoehlerEND:VCALENDAR 103*a1a3b679SAndreas BoehlerICS; 104*a1a3b679SAndreas Boehler 105*a1a3b679SAndreas Boehler 106*a1a3b679SAndreas Boehler $newMessage = null; 107*a1a3b679SAndreas Boehler 108*a1a3b679SAndreas Boehler $version = \Sabre\VObject\Version::VERSION; 109*a1a3b679SAndreas Boehler 110*a1a3b679SAndreas Boehler $expected = array( 111*a1a3b679SAndreas Boehler array( 112*a1a3b679SAndreas Boehler 'uid' => 'foobar', 113*a1a3b679SAndreas Boehler 'method' => 'REPLY', 114*a1a3b679SAndreas Boehler 'component' => 'VEVENT', 115*a1a3b679SAndreas Boehler 'sender' => 'mailto:one@example.org', 116*a1a3b679SAndreas Boehler 'senderName' => 'One', 117*a1a3b679SAndreas Boehler 'recipient' => 'mailto:strunk@example.org', 118*a1a3b679SAndreas Boehler 'recipientName' => 'Strunk', 119*a1a3b679SAndreas Boehler 'message' => <<<ICS 120*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 121*a1a3b679SAndreas BoehlerVERSION:2.0 122*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN 123*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN 124*a1a3b679SAndreas BoehlerMETHOD:REPLY 125*a1a3b679SAndreas BoehlerBEGIN:VEVENT 126*a1a3b679SAndreas BoehlerUID:foobar 127*a1a3b679SAndreas BoehlerSEQUENCE:1 128*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z 129*a1a3b679SAndreas BoehlerSUMMARY:foo 130*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org 131*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org 132*a1a3b679SAndreas BoehlerEND:VEVENT 133*a1a3b679SAndreas BoehlerEND:VCALENDAR 134*a1a3b679SAndreas BoehlerICS 135*a1a3b679SAndreas Boehler ), 136*a1a3b679SAndreas Boehler ); 137*a1a3b679SAndreas Boehler 138*a1a3b679SAndreas Boehler $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org'); 139*a1a3b679SAndreas Boehler 140*a1a3b679SAndreas Boehler 141*a1a3b679SAndreas Boehler } 142*a1a3b679SAndreas Boehler 143*a1a3b679SAndreas Boehler function testAttendeeDeleteCancelledEvent() { 144*a1a3b679SAndreas Boehler 145*a1a3b679SAndreas Boehler $oldMessage = <<<ICS 146*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 147*a1a3b679SAndreas BoehlerVERSION:2.0 148*a1a3b679SAndreas BoehlerBEGIN:VEVENT 149*a1a3b679SAndreas BoehlerSTATUS:CANCELLED 150*a1a3b679SAndreas BoehlerUID:foobar 151*a1a3b679SAndreas BoehlerSEQUENCE:1 152*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org 153*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org 154*a1a3b679SAndreas BoehlerATTENDEE;CN=Two:mailto:two@example.org 155*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z 156*a1a3b679SAndreas BoehlerEND:VEVENT 157*a1a3b679SAndreas BoehlerEND:VCALENDAR 158*a1a3b679SAndreas BoehlerICS; 159*a1a3b679SAndreas Boehler 160*a1a3b679SAndreas Boehler 161*a1a3b679SAndreas Boehler $newMessage = null; 162*a1a3b679SAndreas Boehler 163*a1a3b679SAndreas Boehler $version = \Sabre\VObject\Version::VERSION; 164*a1a3b679SAndreas Boehler 165*a1a3b679SAndreas Boehler $expected = array(); 166*a1a3b679SAndreas Boehler 167*a1a3b679SAndreas Boehler $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org'); 168*a1a3b679SAndreas Boehler 169*a1a3b679SAndreas Boehler 170*a1a3b679SAndreas Boehler } 171*a1a3b679SAndreas Boehler 172*a1a3b679SAndreas Boehler function testNoCalendar() { 173*a1a3b679SAndreas Boehler 174*a1a3b679SAndreas Boehler $this->parse(null, null, array(), 'mailto:one@example.org'); 175*a1a3b679SAndreas Boehler 176*a1a3b679SAndreas Boehler } 177*a1a3b679SAndreas Boehler 178*a1a3b679SAndreas Boehler function testVTodo() { 179*a1a3b679SAndreas Boehler 180*a1a3b679SAndreas Boehler $oldMessage = <<<ICS 181*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR 182*a1a3b679SAndreas BoehlerVERSION:2.0 183*a1a3b679SAndreas BoehlerBEGIN:VTODO 184*a1a3b679SAndreas BoehlerUID:foobar 185*a1a3b679SAndreas BoehlerSEQUENCE:1 186*a1a3b679SAndreas BoehlerEND:VTODO 187*a1a3b679SAndreas BoehlerEND:VCALENDAR 188*a1a3b679SAndreas BoehlerICS; 189*a1a3b679SAndreas Boehler $this->parse($oldMessage, null, array(), 'mailto:one@example.org'); 190*a1a3b679SAndreas Boehler 191*a1a3b679SAndreas Boehler } 192*a1a3b679SAndreas Boehler 193*a1a3b679SAndreas Boehler} 194