11 $data =
"BEGIN:VCALENDAR\r\nEND:VCALENDAR";
15 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
16 $this->assertEquals(
'VCALENDAR',
$result->name);
17 $this->assertEquals(0, count(
$result->children()));
23 $data =
"BEGIN:VCALENDAR\r\nEND:VCALENDAR";
31 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
32 $this->assertEquals(
'VCALENDAR',
$result->name);
33 $this->assertEquals(0, count(
$result->children()));
39 $data =
"BEGIN:VCALENDAR\nEND:VCALENDAR";
43 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
44 $this->assertEquals(
'VCALENDAR',
$result->name);
45 $this->assertEquals(0, count(
$result->children()));
51 $data =
"BEGIN:\r\n\tVCALENDAR\r\nE\r\n ND:VCALENDAR";
55 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
56 $this->assertEquals(
'VCALENDAR',
$result->name);
57 $this->assertEquals(0, count(
$result->children()));
66 $data =
"BEGIN:VCALENDAR\r\nEND:FOO";
77 $data =
"BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nEND:FOO\r\nEND:VCALENDAR";
85 $data =
"BEGIN:VCALENDAR\r\nSUMMARY:propValue\r\nEND:VCALENDAR";
89 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
90 $this->assertEquals(
'SUMMARY',
$result->name);
91 $this->assertEquals(
'propValue',
$result->getValue());
97 $data =
"BEGIN:VCALENDAR\r\nSUMMARY:Line1\\nLine2\\NLine3\\\\Not the 4th line!\r\nEND:VCALENDAR";
101 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
102 $this->assertEquals(
'SUMMARY',
$result->name);
103 $this->assertEquals(
"Line1\nLine2\nLine3\\Not the 4th line!",
$result->getValue());
109 $data =
"BEGIN:VCALENDAR\r\nDTSTART:20110529\r\nEND:VCALENDAR";
113 $this->assertInstanceOf(
'Sabre\\VObject\\Property\\ICalendar\\DateTime',
$result);
114 $this->assertEquals(
'DTSTART',
$result->name);
115 $this->assertEquals(
'20110529',
$result->getValue());
121 $data =
"BEGIN:VCALENDAR\r\nfoo.DTSTART:20110529\r\nEND:VCALENDAR";
125 $this->assertInstanceOf(
'Sabre\\VObject\\Property\\ICalendar\\DateTime',
$result);
126 $this->assertEquals(
'DTSTART',
$result->name);
127 $this->assertEquals(
'20110529',
$result->getValue());
136 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;propValue";
145 "PROPNAME:propValue",
151 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
152 $this->assertEquals(
'VCALENDAR',
$result->name);
153 $this->assertEquals(1, count(
$result->children()));
154 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result->children()[0]);
155 $this->assertEquals(
'PROPNAME',
$result->children()[0]->name);
156 $this->assertEquals(
'propValue',
$result->children()[0]->getValue());
173 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
174 $this->assertEquals(
'VCALENDAR',
$result->name);
175 $this->assertEquals(1, count(
$result->children()));
176 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result->children()[0]);
177 $this->assertEquals(
'VTIMEZONE',
$result->children()[0]->name);
178 $this->assertEquals(1, count(
$result->children()[0]->children()));
179 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result->children()[0]->children()[0]);
180 $this->assertEquals(
'DAYLIGHT',
$result->children()[0]->children()[0]->name);
187 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue:propValue\r\nEND:VCALENDAR";
192 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
193 $this->assertEquals(
'PROPNAME',
$result->name);
194 $this->assertEquals(
'propValue',
$result->getValue());
195 $this->assertEquals(1, count(
$result->parameters()));
196 $this->assertEquals(
'PARAMNAME',
$result->parameters[
'PARAMNAME']->name);
197 $this->assertEquals(
'paramvalue',
$result->parameters[
'PARAMNAME']->getValue());
203 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;N=1;N=2;N=3,4;N=\"5\",6;N=\"7,8\";N=9,10;N=^'11^':propValue\r\nEND:VCALENDAR";
208 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
209 $this->assertEquals(
'PROPNAME',
$result->name);
210 $this->assertEquals(
'propValue',
$result->getValue());
211 $this->assertEquals(1, count(
$result->parameters()));
212 $this->assertEquals(
'N',
$result->parameters[
'N']->name);
213 $this->assertEquals(
'1,2,3,4,5,6,7,8,9,10,"11"',
$result->parameters[
'N']->getValue());
214 $this->assertEquals([1, 2, 3, 4, 5, 6,
"7,8", 9, 10,
'"11"'],
$result->parameters[
'N']->getParts());
220 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;WORK;VOICE;PREF:propValue\r\nEND:VCALENDAR";
225 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
226 $this->assertEquals(
'PROPNAME',
$result->name);
227 $this->assertEquals(
'propValue',
$result->getValue());
228 $this->assertEquals(1, count(
$result->parameters()));
229 $this->assertEquals(
'TYPE',
$result->parameters[
'TYPE']->name);
230 $this->assertEquals(
'WORK,VOICE,PREF',
$result->parameters[
'TYPE']->getValue());
231 $this->assertEquals([
'WORK',
'VOICE',
'PREF'],
$result->parameters[
'TYPE']->getParts());
237 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PRODIGY:propValue\r\nEND:VCALENDAR";
242 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
243 $this->assertEquals(
'PROPNAME',
$result->name);
244 $this->assertEquals(
'propValue',
$result->getValue());
245 $this->assertEquals(1, count(
$result->parameters()));
246 $this->assertEquals(
'TYPE',
$result->parameters[
'TYPE']->name);
247 $this->assertTrue(
$result->parameters[
'TYPE']->noName);
248 $this->assertEquals(
'PRODIGY',
$result->parameters[
'TYPE']);
254 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue:propValue:anotherrandomstring\r\nEND:VCALENDAR";
259 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
260 $this->assertEquals(
'PROPNAME',
$result->name);
261 $this->assertEquals(
'propValue:anotherrandomstring',
$result->getValue());
262 $this->assertEquals(1, count(
$result->parameters()));
263 $this->assertEquals(
'PARAMNAME',
$result->parameters[
'PARAMNAME']->name);
264 $this->assertEquals(
'paramvalue',
$result->parameters[
'PARAMNAME']->getValue());
270 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue;PARAMNAME2=paramvalue2:propValue\r\nEND:VCALENDAR";
275 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
276 $this->assertEquals(
'PROPNAME',
$result->name);
277 $this->assertEquals(
'propValue',
$result->getValue());
278 $this->assertEquals(2, count(
$result->parameters()));
279 $this->assertEquals(
'PARAMNAME',
$result->parameters[
'PARAMNAME']->name);
280 $this->assertEquals(
'paramvalue',
$result->parameters[
'PARAMNAME']->getValue());
281 $this->assertEquals(
'PARAMNAME2',
$result->parameters[
'PARAMNAME2']->name);
282 $this->assertEquals(
'paramvalue2',
$result->parameters[
'PARAMNAME2']->getValue());
288 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=\"paramvalue\":propValue\r\nEND:VCALENDAR";
293 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
294 $this->assertEquals(
'PROPNAME',
$result->name);
295 $this->assertEquals(
'propValue',
$result->getValue());
296 $this->assertEquals(1, count(
$result->parameters()));
297 $this->assertEquals(
'PARAMNAME',
$result->parameters[
'PARAMNAME']->name);
298 $this->assertEquals(
'paramvalue',
$result->parameters[
'PARAMNAME']->getValue());
304 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=paramvalue1^nvalue2^^nvalue3:propValue\r\nEND:VCALENDAR";
309 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
310 $this->assertEquals(
'PROPNAME',
$result->name);
311 $this->assertEquals(
'propValue',
$result->getValue());
313 $this->assertEquals(1, count(
$result->parameters()));
314 $this->assertEquals(
'PARAMNAME',
$result->parameters[
'PARAMNAME']->name);
315 $this->assertEquals(
"paramvalue1\nvalue2^nvalue3",
$result->parameters[
'PARAMNAME']->getValue());
321 $data =
"BEGIN:VCALENDAR\r\nPROPNAME;PARAMNAME=\"param:value\":propValue\r\nEND:VCALENDAR";
325 $this->assertInstanceOf(
'Sabre\\VObject\\Property',
$result);
326 $this->assertEquals(
'PROPNAME',
$result->name);
327 $this->assertEquals(
'propValue',
$result->getValue());
328 $this->assertEquals(1, count(
$result->parameters()));
329 $this->assertEquals(
'PARAMNAME',
$result->parameters[
'PARAMNAME']->name);
330 $this->assertEquals(
'param:value',
$result->parameters[
'PARAMNAME']->getValue());
349 $this->assertEquals(
true, $caught);
353 $expected = implode(
"\r\n", [
360 $this->assertEquals($expected,
$result->serialize());
368 "DESCRIPTION:propValue",
369 "Yes, we've actually seen a file with non-idented property values on multiple lines",
380 $this->assertEquals(
true, $caught);
384 $expected = implode(
"\r\n", [
386 "DESCRIPTION:propValue",
391 $this->assertEquals($expected,
$result->serialize());
406 X-FUNAMBOL-FOLDER:DEFAULT_FOLDER
408 DTSTART:20111017T110000Z
409 DTEND:20111017T123000Z
410 X-MICROSOFT-CDO-BUSYSTATUS:BUSY
412 LOCATION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Netviewer Meeting
415 X-MICROSOFT-CDO-REPLYTIME:20111017T064200Z
416 SUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Kopieren:
test 420 X-FUNAMBOL-BILLINGINFO:
421 X-FUNAMBOL-COMPANIES:
424 ATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:
'Heino' heino@
test.com
425 ATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:
'Markus' test@
test.com
426 ATTENDEE;STATUS=NEEDS AC
444 $data = chr(0xef) . chr(0xbb) . chr(0xbf) .
"BEGIN:VCALENDAR\r\nEND:VCALENDAR";
447 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
448 $this->assertEquals(
'VCALENDAR',
$result->name);
449 $this->assertEquals(0, count(
$result->children()));
456 <?xml version=
"1.0" encoding=
"utf-8"?>
457 <icalendar xmlns=
"urn:ietf:params:xml:ns:icalendar-2.0">
465 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
466 $this->assertEquals(
'VCALENDAR',
$result->name);
467 $this->assertEquals(0, count(
$result->children()));
474 <?xml version=
"1.0" encoding=
"utf-8"?>
475 <icalendar xmlns=
"urn:ietf:params:xml:ns:icalendar-2.0">
487 $this->assertInstanceOf(
'Sabre\\VObject\\Component',
$result);
488 $this->assertEquals(
'VCALENDAR',
$result->name);
489 $this->assertEquals(0, count(
$result->children()));
testReadPropertyParameterQuoted()
testReadComponentLineFold()
testReadComponentUnixNewLine()
testReadWithInvalidLine()
$stream
PHP stream implementation.
testReadCorruptSubComponent()
Sabre
testReadPropertyInComponent()
testReadIncompleteFile()
Reported as Issue 32.
const OPTION_IGNORE_INVALID_LINES
If this option is turned on, any lines we cannot parse will be ignored by the reader.
testReadProperty2Parameters()
testReadPropertyParameterExtraColon()
static readXML($data, $options=0)
Parses a xCard or xCal object, and returns the top component.
testReadMappedPropertyGrouped()
testReadPropertyParameterNewLines()
testReadPropertyRepeatingParameter()
testReadPropertyParameterQuotedColon()
testReadBrokenLine()
Sabre
const OPTION_FORGIVING
If this option is passed to the reader, it will be less strict about the validity of the lines...
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Exception thrown by Reader if an invalid object was attempted to be parsed.
testReadPropertyParameter()
testReadPropertyRepeatingNamelessGuessedParameter()
testReadCorruptComponent()
Sabre
testReadPropertyWithNewLine()
testReadNestedComponent()