Definition at line 7 of file ReaderTest.php.
◆ testReadBOM()
Sabre\VObject\ReaderTest::testReadBOM |
( |
| ) |
|
Definition at line 442 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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()));
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadBrokenInput()
Sabre\VObject\ReaderTest::testReadBrokenInput |
( |
| ) |
|
◆ testReadBrokenLine()
Sabre\VObject\ReaderTest::testReadBrokenLine |
( |
| ) |
|
◆ testReadComponent()
Sabre\VObject\ReaderTest::testReadComponent |
( |
| ) |
|
Definition at line 9 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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()));
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadComponentLineFold()
Sabre\VObject\ReaderTest::testReadComponentLineFold |
( |
| ) |
|
Definition at line 49 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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()));
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadComponentUnixNewLine()
Sabre\VObject\ReaderTest::testReadComponentUnixNewLine |
( |
| ) |
|
Definition at line 37 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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()));
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadCorruptComponent()
Sabre\VObject\ReaderTest::testReadCorruptComponent |
( |
| ) |
|
◆ testReadCorruptSubComponent()
Sabre\VObject\ReaderTest::testReadCorruptSubComponent |
( |
| ) |
|
◆ testReadForgiving()
Sabre\VObject\ReaderTest::testReadForgiving |
( |
| ) |
|
Definition at line 334 of file ReaderTest.php.
References $data, $result, Sabre\VObject\Reader\OPTION_FORGIVING, and Sabre\VObject\Reader\read().
345 }
catch (ParseException $e) {
349 $this->assertEquals(
true, $caught);
353 $expected = implode(
"\r\n", [
360 $this->assertEquals($expected,
$result->serialize());
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.
◆ testReadIncompleteFile()
Sabre\VObject\ReaderTest::testReadIncompleteFile |
( |
| ) |
|
Reported as Issue 32.
Definition at line 400 of file ReaderTest.php.
References Sabre\VObject\$input, Sabre\VObject\Reader\read(), and test().
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
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadMappedProperty()
Sabre\VObject\ReaderTest::testReadMappedProperty |
( |
| ) |
|
Definition at line 107 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadMappedPropertyGrouped()
Sabre\VObject\ReaderTest::testReadMappedPropertyGrouped |
( |
| ) |
|
Definition at line 119 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadNestedComponent()
Sabre\VObject\ReaderTest::testReadNestedComponent |
( |
| ) |
|
Definition at line 160 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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);
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadProperty()
Sabre\VObject\ReaderTest::testReadProperty |
( |
| ) |
|
Definition at line 83 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadProperty2Parameters()
Sabre\VObject\ReaderTest::testReadProperty2Parameters |
( |
| ) |
|
Definition at line 268 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyInComponent()
Sabre\VObject\ReaderTest::testReadPropertyInComponent |
( |
| ) |
|
Definition at line 141 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyNoName()
Sabre\VObject\ReaderTest::testReadPropertyNoName |
( |
| ) |
|
Definition at line 235 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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']);
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyParameter()
Sabre\VObject\ReaderTest::testReadPropertyParameter |
( |
| ) |
|
Definition at line 185 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyParameterExtraColon()
Sabre\VObject\ReaderTest::testReadPropertyParameterExtraColon |
( |
| ) |
|
Definition at line 252 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyParameterNewLines()
Sabre\VObject\ReaderTest::testReadPropertyParameterNewLines |
( |
| ) |
|
Definition at line 302 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyParameterQuoted()
Sabre\VObject\ReaderTest::testReadPropertyParameterQuoted |
( |
| ) |
|
Definition at line 286 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyParameterQuotedColon()
Sabre\VObject\ReaderTest::testReadPropertyParameterQuotedColon |
( |
| ) |
|
Definition at line 319 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyRepeatingNamelessGuessedParameter()
Sabre\VObject\ReaderTest::testReadPropertyRepeatingNamelessGuessedParameter |
( |
| ) |
|
Definition at line 218 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyRepeatingParameter()
Sabre\VObject\ReaderTest::testReadPropertyRepeatingParameter |
( |
| ) |
|
Definition at line 201 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadPropertyWithNewLine()
Sabre\VObject\ReaderTest::testReadPropertyWithNewLine |
( |
| ) |
|
Definition at line 95 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\read().
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());
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadStream()
Sabre\VObject\ReaderTest::testReadStream |
( |
| ) |
|
◆ testReadWithInvalidLine()
Sabre\VObject\ReaderTest::testReadWithInvalidLine |
( |
| ) |
|
Definition at line 364 of file ReaderTest.php.
References $data, $result, Sabre\VObject\Reader\OPTION_IGNORE_INVALID_LINES, and Sabre\VObject\Reader\read().
368 "DESCRIPTION:propValue",
369 "Yes, we've actually seen a file with non-idented property values on multiple lines",
376 }
catch (ParseException $e) {
380 $this->assertEquals(
true, $caught);
384 $expected = implode(
"\r\n", [
386 "DESCRIPTION:propValue",
391 $this->assertEquals($expected,
$result->serialize());
const OPTION_IGNORE_INVALID_LINES
If this option is turned on, any lines we cannot parse will be ignored by the reader.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
◆ testReadXMLComponent()
Sabre\VObject\ReaderTest::testReadXMLComponent |
( |
| ) |
|
Definition at line 453 of file ReaderTest.php.
References $data, $result, and Sabre\VObject\Reader\readXML().
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()));
static readXML($data, $options=0)
Parses a xCard or xCal object, and returns the top component.
◆ testReadXMLStream()
Sabre\VObject\ReaderTest::testReadXMLStream |
( |
| ) |
|
Definition at line 471 of file ReaderTest.php.
References $data, $result, GuzzleHttp\Psr7\$stream, and Sabre\VObject\Reader\readXML().
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()));
$stream
PHP stream implementation.
static readXML($data, $options=0)
Parses a xCard or xCal object, and returns the top component.
The documentation for this class was generated from the following file: