ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
XmlTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\VObject\Parser;
4 
6 use Sabre\VObject;
7 
8 class XmlTest extends TestCase {
9 
11 
12  function testRFC6321Example1() {
13 
15 <<<XML
16 <?xml version="1.0" encoding="UTF-8"?>
17 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
18  <vcalendar>
19  <properties>
20  <calscale>
21  <text>GREGORIAN</text>
22  </calscale>
23  <prodid>
24  <text>-//Example Inc.//Example Calendar//EN</text>
25  </prodid>
26  <version>
27  <text>2.0</text>
28  </version>
29  </properties>
30  <components>
31  <vevent>
32  <properties>
33  <dtstamp>
34  <date-time>2008-02-05T19:12:24Z</date-time>
35  </dtstamp>
36  <dtstart>
37  <date>2008-10-06</date>
38  </dtstart>
39  <summary>
40  <text>Planning meeting</text>
41  </summary>
42  <uid>
43  <text>4088E990AD89CB3DBB484909</text>
44  </uid>
45  </properties>
46  </vevent>
47  </components>
48  </vcalendar>
49 </icalendar>
50 XML
51 ,
52  'BEGIN:VCALENDAR' . "\n" .
53  // VERSION comes first because this is required by vCard 4.0.
54  'VERSION:2.0' . "\n" .
55  'CALSCALE:GREGORIAN' . "\n" .
56  'PRODID:-//Example Inc.//Example Calendar//EN' . "\n" .
57  'BEGIN:VEVENT' . "\n" .
58  'DTSTAMP:20080205T191224Z' . "\n" .
59  'DTSTART;VALUE=DATE:20081006' . "\n" .
60  'SUMMARY:Planning meeting' . "\n" .
61  'UID:4088E990AD89CB3DBB484909' . "\n" .
62  'END:VEVENT' . "\n" .
63  'END:VCALENDAR' . "\n"
64  );
65 
66  }
67 
68  function testRFC6321Example2() {
69 
70  $xml = <<<XML
71 <?xml version="1.0" encoding="UTF-8" ?>
72 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
73  <vcalendar>
74  <properties>
75  <prodid>
76  <text>-//Example Inc.//Example Client//EN</text>
77  </prodid>
78  <version>
79  <text>2.0</text>
80  </version>
81  </properties>
82  <components>
83  <vtimezone>
84  <properties>
85  <last-modified>
86  <date-time>2004-01-10T03:28:45Z</date-time>
87  </last-modified>
88  <tzid><text>US/Eastern</text></tzid>
89  </properties>
90  <components>
91  <daylight>
92  <properties>
93  <dtstart>
94  <date-time>2000-04-04T02:00:00</date-time>
95  </dtstart>
96  <rrule>
97  <recur>
98  <freq>YEARLY</freq>
99  <byday>1SU</byday>
100  <bymonth>4</bymonth>
101  </recur>
102  </rrule>
103  <tzname>
104  <text>EDT</text>
105  </tzname>
106  <tzoffsetfrom>
107  <utc-offset>-05:00</utc-offset>
108  </tzoffsetfrom>
109  <tzoffsetto>
110  <utc-offset>-04:00</utc-offset>
111  </tzoffsetto>
112  </properties>
113  </daylight>
114  <standard>
115  <properties>
116  <dtstart>
117  <date-time>2000-10-26T02:00:00</date-time>
118  </dtstart>
119  <rrule>
120  <recur>
121  <freq>YEARLY</freq>
122  <byday>-1SU</byday>
123  <bymonth>10</bymonth>
124  </recur>
125  </rrule>
126  <tzname>
127  <text>EST</text>
128  </tzname>
129  <tzoffsetfrom>
130  <utc-offset>-04:00</utc-offset>
131  </tzoffsetfrom>
132  <tzoffsetto>
133  <utc-offset>-05:00</utc-offset>
134  </tzoffsetto>
135  </properties>
136  </standard>
137  </components>
138  </vtimezone>
139  <vevent>
140  <properties>
141  <dtstamp>
142  <date-time>2006-02-06T00:11:21Z</date-time>
143  </dtstamp>
144  <dtstart>
145  <parameters>
146  <tzid><text>US/Eastern</text></tzid>
147  </parameters>
148  <date-time>2006-01-02T12:00:00</date-time>
149  </dtstart>
150  <duration>
151  <duration>PT1H</duration>
152  </duration>
153  <rrule>
154  <recur>
155  <freq>DAILY</freq>
156  <count>5</count>
157  </recur>
158  </rrule>
159  <rdate>
160  <parameters>
161  <tzid><text>US/Eastern</text></tzid>
162  </parameters>
163  <period>
164  <start>2006-01-02T15:00:00</start>
165  <duration>PT2H</duration>
166  </period>
167  </rdate>
168  <summary>
169  <text>Event #2</text>
170  </summary>
171  <description>
172  <text>We are having a meeting all this week at 12
173 pm for one hour, with an additional meeting on the first day
174 2 hours long.&#x0a;Please bring your own lunch for the 12 pm
175 meetings.</text>
176  </description>
177  <uid>
178  <text>00959BC664CA650E933C892C@example.com</text>
179  </uid>
180  </properties>
181  </vevent>
182  <vevent>
183  <properties>
184  <dtstamp>
185  <date-time>2006-02-06T00:11:21Z</date-time>
186  </dtstamp>
187  <dtstart>
188  <parameters>
189  <tzid><text>US/Eastern</text></tzid>
190  </parameters>
191  <date-time>2006-01-04T14:00:00</date-time>
192  </dtstart>
193  <duration>
194  <duration>PT1H</duration>
195  </duration>
196  <recurrence-id>
197  <parameters>
198  <tzid><text>US/Eastern</text></tzid>
199  </parameters>
200  <date-time>2006-01-04T12:00:00</date-time>
201  </recurrence-id>
202  <summary>
203  <text>Event #2 bis</text>
204  </summary>
205  <uid>
206  <text>00959BC664CA650E933C892C@example.com</text>
207  </uid>
208  </properties>
209  </vevent>
210  </components>
211  </vcalendar>
212 </icalendar>
213 XML;
214 
215  $component = VObject\Reader::readXML($xml);
216  $this->assertVObjectEqualsVObject(
217  'BEGIN:VCALENDAR' . "\n" .
218  'VERSION:2.0' . "\n" .
219  'PRODID:-//Example Inc.//Example Client//EN' . "\n" .
220  'BEGIN:VTIMEZONE' . "\n" .
221  'LAST-MODIFIED:20040110T032845Z' . "\n" .
222  'TZID:US/Eastern' . "\n" .
223  'BEGIN:DAYLIGHT' . "\n" .
224  'DTSTART:20000404T020000' . "\n" .
225  'RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4' . "\n" .
226  'TZNAME:EDT' . "\n" .
227  'TZOFFSETFROM:-0500' . "\n" .
228  'TZOFFSETTO:-0400' . "\n" .
229  'END:DAYLIGHT' . "\n" .
230  'BEGIN:STANDARD' . "\n" .
231  'DTSTART:20001026T020000' . "\n" .
232  'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10' . "\n" .
233  'TZNAME:EST' . "\n" .
234  'TZOFFSETFROM:-0400' . "\n" .
235  'TZOFFSETTO:-0500' . "\n" .
236  'END:STANDARD' . "\n" .
237  'END:VTIMEZONE' . "\n" .
238  'BEGIN:VEVENT' . "\n" .
239  'DTSTAMP:20060206T001121Z' . "\n" .
240  'DTSTART;TZID=US/Eastern:20060102T120000' . "\n" .
241  'DURATION:PT1H' . "\n" .
242  'RRULE:FREQ=DAILY;COUNT=5' . "\n" .
243  'RDATE;TZID=US/Eastern;VALUE=PERIOD:20060102T150000/PT2H' . "\n" .
244  'SUMMARY:Event #2' . "\n" .
245  'DESCRIPTION:We are having a meeting all this week at 12\npm for one hour\, ' . "\n" .
246  ' with an additional meeting on the first day\n2 hours long.\nPlease bring y' . "\n" .
247  ' our own lunch for the 12 pm\nmeetings.' . "\n" .
248  'UID:00959BC664CA650E933C892C@example.com' . "\n" .
249  'END:VEVENT' . "\n" .
250  'BEGIN:VEVENT' . "\n" .
251  'DTSTAMP:20060206T001121Z' . "\n" .
252  'DTSTART;TZID=US/Eastern:20060104T140000' . "\n" .
253  'DURATION:PT1H' . "\n" .
254  'RECURRENCE-ID;TZID=US/Eastern:20060104T120000' . "\n" .
255  'SUMMARY:Event #2 bis' . "\n" .
256  'UID:00959BC664CA650E933C892C@example.com' . "\n" .
257  'END:VEVENT' . "\n" .
258  'END:VCALENDAR' . "\n",
259  VObject\Writer::write($component)
260  );
261 
262  }
263 
268 
270 <<<XML
271 <?xml version="1.0" encoding="UTF-8"?>
272 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
273  <vcalendar/>
274 </icalendar>
275 XML
276 ,
277  'BEGIN:VCALENDAR' . "\n" .
278  'END:VCALENDAR' . "\n"
279  );
280  }
281 
286 
288 <<<XML
289 <?xml version="1.0" encoding="UTF-8"?>
290 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
291  <vcalendar>
292  <components>
293  <vtimezone/>
294  <vevent/>
295  <vtodo/>
296  <vjournal/>
297  <vfreebusy/>
298  <standard/>
299  <daylight/>
300  <valarm/>
301  </components>
302  </vcalendar>
303 </icalendar>
304 XML
305 ,
306  'BEGIN:VCALENDAR' . "\n" .
307  'BEGIN:VTIMEZONE' . "\n" .
308  'END:VTIMEZONE' . "\n" .
309  'BEGIN:VEVENT' . "\n" .
310  'END:VEVENT' . "\n" .
311  'BEGIN:VTODO' . "\n" .
312  'END:VTODO' . "\n" .
313  'BEGIN:VJOURNAL' . "\n" .
314  'END:VJOURNAL' . "\n" .
315  'BEGIN:VFREEBUSY' . "\n" .
316  'END:VFREEBUSY' . "\n" .
317  'BEGIN:STANDARD' . "\n" .
318  'END:STANDARD' . "\n" .
319  'BEGIN:DAYLIGHT' . "\n" .
320  'END:DAYLIGHT' . "\n" .
321  'BEGIN:VALARM' . "\n" .
322  'END:VALARM' . "\n" .
323  'END:VCALENDAR' . "\n"
324  );
325 
326  }
327 
332 
334 <<<XML
335 <?xml version="1.0" encoding="UTF-8"?>
336 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
337  <vcalendar>
338  <properties>
339  <geo>
340  <latitude>37.386013</latitude>
341  <longitude>-122.082932</longitude>
342  </geo>
343  </properties>
344  </vcalendar>
345 </icalendar>
346 XML
347 ,
348  'BEGIN:VCALENDAR' . "\n" .
349  'GEO:37.386013;-122.082932' . "\n" .
350  'END:VCALENDAR' . "\n"
351  );
352 
353  }
354 
359 
360  // Example 1 of RFC5545, Section 3.8.8.3.
362 <<<XML
363 <?xml version="1.0" encoding="UTF-8"?>
364 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
365  <vcalendar>
366  <properties>
367  <request-status>
368  <code>2.0</code>
369  <description>Success</description>
370  </request-status>
371  </properties>
372  </vcalendar>
373 </icalendar>
374 XML
375 ,
376  'BEGIN:VCALENDAR' . "\n" .
377  'REQUEST-STATUS:2.0;Success' . "\n" .
378  'END:VCALENDAR' . "\n"
379  );
380 
381  // Example 2 of RFC5545, Section 3.8.8.3.
383 <<<XML
384 <?xml version="1.0" encoding="UTF-8"?>
385 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
386  <vcalendar>
387  <properties>
388  <request-status>
389  <code>3.1</code>
390  <description>Invalid property value</description>
391  <data>DTSTART:96-Apr-01</data>
392  </request-status>
393  </properties>
394  </vcalendar>
395 </icalendar>
396 XML
397 ,
398  'BEGIN:VCALENDAR' . "\n" .
399  'REQUEST-STATUS:3.1;Invalid property value;DTSTART:96-Apr-01' . "\n" .
400  'END:VCALENDAR' . "\n"
401  );
402 
403  // Example 3 of RFC5545, Section 3.8.8.3.
405 <<<XML
406 <?xml version="1.0" encoding="UTF-8"?>
407 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
408  <vcalendar>
409  <properties>
410  <request-status>
411  <code>2.8</code>
412  <description>Success, repeating event ignored. Scheduled as a single event.</description>
413  <data>RRULE:FREQ=WEEKLY;INTERVAL=2</data>
414  </request-status>
415  </properties>
416  </vcalendar>
417 </icalendar>
418 XML
419 ,
420  'BEGIN:VCALENDAR' . "\n" .
421  'REQUEST-STATUS:2.8;Success\, repeating event ignored. Scheduled as a single' . "\n" .
422  ' event.;RRULE:FREQ=WEEKLY\;INTERVAL=2' . "\n" .
423  'END:VCALENDAR' . "\n"
424  );
425 
426  // Example 4 of RFC5545, Section 3.8.8.3.
428 <<<XML
429 <?xml version="1.0" encoding="UTF-8"?>
430 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
431  <vcalendar>
432  <properties>
433  <request-status>
434  <code>4.1</code>
435  <description>Event conflict. Date-time is busy.</description>
436  </request-status>
437  </properties>
438  </vcalendar>
439 </icalendar>
440 XML
441 ,
442  'BEGIN:VCALENDAR' . "\n" .
443  'REQUEST-STATUS:4.1;Event conflict. Date-time is busy.' . "\n" .
444  'END:VCALENDAR' . "\n"
445  );
446 
447  // Example 5 of RFC5545, Section 3.8.8.3.
449 <<<XML
450 <?xml version="1.0" encoding="UTF-8"?>
451 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
452  <vcalendar>
453  <properties>
454  <request-status>
455  <code>3.7</code>
456  <description>Invalid calendar user</description>
457  <data>ATTENDEE:mailto:jsmith@example.com</data>
458  </request-status>
459  </properties>
460  </vcalendar>
461 </icalendar>
462 XML
463 ,
464  'BEGIN:VCALENDAR' . "\n" .
465  'REQUEST-STATUS:3.7;Invalid calendar user;ATTENDEE:mailto:jsmith@example.com' . "\n" .
466  'END:VCALENDAR' . "\n"
467  );
468 
469  }
470 
475 
477 <<<XML
478 <?xml version="1.0" encoding="UTF-8"?>
479 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
480  <vcalendar>
481  <properties>
482  <attach>
483  <binary>SGVsbG8gV29ybGQh</binary>
484  </attach>
485  </properties>
486  </vcalendar>
487 </icalendar>
488 XML
489 ,
490  'BEGIN:VCALENDAR' . "\n" .
491  'ATTACH:SGVsbG8gV29ybGQh' . "\n" .
492  'END:VCALENDAR' . "\n"
493  );
494 
495  // In vCard 4, BINARY no longer exists and is replaced by URI.
497 <<<XML
498 <?xml version="1.0" encoding="UTF-8"?>
499 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
500  <vcalendar>
501  <properties>
502  <attach>
503  <uri>SGVsbG8gV29ybGQh</uri>
504  </attach>
505  </properties>
506  </vcalendar>
507 </icalendar>
508 XML
509 ,
510  'BEGIN:VCALENDAR' . "\n" .
511  'ATTACH:SGVsbG8gV29ybGQh' . "\n" .
512  'END:VCALENDAR' . "\n"
513  );
514 
515  }
516 
521 
523 <<<XML
524 <?xml version="1.0" encoding="UTF-8"?>
525 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
526  <vcalendar>
527  <properties>
528  <attendee>
529  <parameters>
530  <rsvp><boolean>true</boolean></rsvp>
531  </parameters>
532  <cal-address>mailto:cyrus@example.com</cal-address>
533  </attendee>
534  </properties>
535  </vcalendar>
536 </icalendar>
537 XML
538 ,
539  'BEGIN:VCALENDAR' . "\n" .
540  'ATTENDEE;RSVP=true:mailto:cyrus@example.com' . "\n" .
541  'END:VCALENDAR' . "\n"
542  );
543 
544  }
545 
550 
552 <<<XML
553 <?xml version="1.0" encoding="UTF-8"?>
554 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
555  <vcalendar>
556  <properties>
557  <attendee>
558  <cal-address>mailto:cyrus@example.com</cal-address>
559  </attendee>
560  </properties>
561  </vcalendar>
562 </icalendar>
563 XML
564 ,
565  'BEGIN:VCALENDAR' . "\n" .
566  'ATTENDEE:mailto:cyrus@example.com' . "\n" .
567  'END:VCALENDAR' . "\n"
568  );
569 
570  }
571 
576 
578 <<<XML
579 <?xml version="1.0" encoding="UTF-8"?>
580 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
581  <vcalendar>
582  <properties>
583  <dtstart>
584  <date>2011-05-17</date>
585  </dtstart>
586  </properties>
587  </vcalendar>
588 </icalendar>
589 XML
590 ,
591  'BEGIN:VCALENDAR' . "\n" .
592  'DTSTART;VALUE=DATE:20110517' . "\n" .
593  'END:VCALENDAR' . "\n"
594  );
595 
596  }
597 
602 
604 <<<XML
605 <?xml version="1.0" encoding="UTF-8"?>
606 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
607  <vcalendar>
608  <properties>
609  <dtstart>
610  <date-time>2011-05-17T12:00:00</date-time>
611  </dtstart>
612  </properties>
613  </vcalendar>
614 </icalendar>
615 XML
616 ,
617  'BEGIN:VCALENDAR' . "\n" .
618  'DTSTART:20110517T120000' . "\n" .
619  'END:VCALENDAR' . "\n"
620  );
621 
622  }
623 
628 
630 <<<XML
631 <?xml version="1.0" encoding="UTF-8"?>
632 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
633  <vcalendar>
634  <properties>
635  <duration>
636  <duration>P1D</duration>
637  </duration>
638  </properties>
639  </vcalendar>
640 </icalendar>
641 XML
642 ,
643  'BEGIN:VCALENDAR' . "\n" .
644  'DURATION:P1D' . "\n" .
645  'END:VCALENDAR' . "\n"
646  );
647 
648  }
649 
654 
655  // GEO uses <float /> with a positive and a non-negative numbers.
656  $this->testRFC6321Section3_4_1_2();
657 
658  }
659 
664 
666 <<<XML
667 <?xml version="1.0" encoding="UTF-8"?>
668 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
669  <vcalendar>
670  <properties>
671  <foo>
672  <integer>42</integer>
673  </foo>
674  </properties>
675  </vcalendar>
676 </icalendar>
677 XML
678 ,
679  'BEGIN:VCALENDAR' . "\n" .
680  'FOO:42' . "\n" .
681  'END:VCALENDAR' . "\n"
682  );
683 
685 <<<XML
686 <?xml version="1.0" encoding="UTF-8"?>
687 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
688  <vcalendar>
689  <properties>
690  <foo>
691  <integer>-42</integer>
692  </foo>
693  </properties>
694  </vcalendar>
695 </icalendar>
696 XML
697 ,
698  'BEGIN:VCALENDAR' . "\n" .
699  'FOO:-42' . "\n" .
700  'END:VCALENDAR' . "\n"
701  );
702 
703  }
704 
709 
711 <<<XML
712 <?xml version="1.0" encoding="UTF-8"?>
713 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
714  <vcalendar>
715  <properties>
716  <freebusy>
717  <period>
718  <start>2011-05-17T12:00:00</start>
719  <duration>P1H</duration>
720  </period>
721  </freebusy>
722  </properties>
723  </vcalendar>
724 </icalendar>
725 XML
726 ,
727  'BEGIN:VCALENDAR' . "\n" .
728  'FREEBUSY:20110517T120000/P1H' . "\n" .
729  'END:VCALENDAR' . "\n"
730  );
731 
733 <<<XML
734 <?xml version="1.0" encoding="UTF-8"?>
735 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
736  <vcalendar>
737  <properties>
738  <freebusy>
739  <period>
740  <start>2011-05-17T12:00:00</start>
741  <end>2012-05-17T12:00:00</end>
742  </period>
743  </freebusy>
744  </properties>
745  </vcalendar>
746 </icalendar>
747 XML
748 ,
749  'BEGIN:VCALENDAR' . "\n" .
750  'FREEBUSY:20110517T120000/20120517T120000' . "\n" .
751  'END:VCALENDAR' . "\n"
752  );
753 
754  }
755 
760 
762 <<<XML
763 <?xml version="1.0" encoding="UTF-8"?>
764 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
765  <vcalendar>
766  <properties>
767  <rrule>
768  <recur>
769  <freq>YEARLY</freq>
770  <count>5</count>
771  <byday>-1SU</byday>
772  <bymonth>10</bymonth>
773  </recur>
774  </rrule>
775  </properties>
776  </vcalendar>
777 </icalendar>
778 XML
779 ,
780  'BEGIN:VCALENDAR' . "\n" .
781  'RRULE:FREQ=YEARLY;COUNT=5;BYDAY=-1SU;BYMONTH=10' . "\n" .
782  'END:VCALENDAR' . "\n"
783  );
784 
785  }
786 
791 
793 <<<XML
794 <?xml version="1.0" encoding="UTF-8"?>
795 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
796  <vcalendar>
797  <properties>
798  <calscale>
799  <text>GREGORIAN</text>
800  </calscale>
801  </properties>
802  </vcalendar>
803 </icalendar>
804 XML
805 ,
806  'BEGIN:VCALENDAR' . "\n" .
807  'CALSCALE:GREGORIAN' . "\n" .
808  'END:VCALENDAR' . "\n"
809  );
810 
811  }
812 
817 
819 <<<XML
820 <?xml version="1.0" encoding="UTF-8"?>
821 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
822  <vcalendar>
823  <properties>
824  <foo>
825  <time>12:00:00</time>
826  </foo>
827  </properties>
828  </vcalendar>
829 </icalendar>
830 XML
831 ,
832  'BEGIN:VCALENDAR' . "\n" .
833  'FOO:120000' . "\n" .
834  'END:VCALENDAR' . "\n"
835  );
836 
837  }
838 
843 
845 <<<XML
846 <?xml version="1.0" encoding="UTF-8"?>
847 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
848  <vcalendar>
849  <properties>
850  <attach>
851  <uri>http://calendar.example.com</uri>
852  </attach>
853  </properties>
854  </vcalendar>
855 </icalendar>
856 XML
857 ,
858  'BEGIN:VCALENDAR' . "\n" .
859  'ATTACH:http://calendar.example.com' . "\n" .
860  'END:VCALENDAR' . "\n"
861  );
862 
863  }
864 
869 
870  // Example 1 of RFC5545, Section 3.3.14.
872 <<<XML
873 <?xml version="1.0" encoding="UTF-8"?>
874 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
875  <vcalendar>
876  <properties>
877  <tzoffsetfrom>
878  <utc-offset>-05:00</utc-offset>
879  </tzoffsetfrom>
880  </properties>
881  </vcalendar>
882 </icalendar>
883 XML
884 ,
885  'BEGIN:VCALENDAR' . "\n" .
886  'TZOFFSETFROM:-0500' . "\n" .
887  'END:VCALENDAR' . "\n"
888  );
889 
890  // Example 2 of RFC5545, Section 3.3.14.
892 <<<XML
893 <?xml version="1.0" encoding="UTF-8"?>
894 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
895  <vcalendar>
896  <properties>
897  <tzoffsetfrom>
898  <utc-offset>+01:00</utc-offset>
899  </tzoffsetfrom>
900  </properties>
901  </vcalendar>
902 </icalendar>
903 XML
904 ,
905  'BEGIN:VCALENDAR' . "\n" .
906  'TZOFFSETFROM:+0100' . "\n" .
907  'END:VCALENDAR' . "\n"
908  );
909 
910  }
911 
915  function testRFC6321Section5() {
916 
918 <<<XML
919 <?xml version="1.0" encoding="UTF-8"?>
920 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
921  <vcalendar>
922  <properties>
923  <x-property>
924  <unknown>20110512T120000Z</unknown>
925  </x-property>
926  </properties>
927  </vcalendar>
928 </icalendar>
929 XML
930 ,
931  'BEGIN:VCALENDAR' . "\n" .
932  'X-PROPERTY:20110512T120000Z' . "\n" .
933  'END:VCALENDAR' . "\n"
934  );
935 
937 <<<XML
938 <?xml version="1.0" encoding="UTF-8"?>
939 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
940  <vcalendar>
941  <properties>
942  <dtstart>
943  <parameters>
944  <x-param>
945  <text>PT30M</text>
946  </x-param>
947  </parameters>
948  <date-time>2011-05-12T13:00:00Z</date-time>
949  </dtstart>
950  </properties>
951  </vcalendar>
952 </icalendar>
953 XML
954 ,
955  'BEGIN:VCALENDAR' . "\n" .
956  'DTSTART;X-PARAM=PT30M:20110512T130000Z' . "\n" .
957  'END:VCALENDAR' . "\n"
958  );
959 
960  }
961 
963 
965 <<<XML
966 <?xml version="1.0" encoding="UTF-8"?>
967 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
968  <vcalendar>
969  <properties>
970  <rdate>
971  <date-time>2008-02-05T19:12:24Z</date-time>
972  </rdate>
973  </properties>
974  </vcalendar>
975 </icalendar>
976 XML
977 ,
978  'BEGIN:VCALENDAR' . "\n" .
979  'RDATE:20080205T191224Z' . "\n" .
980  'END:VCALENDAR' . "\n"
981  );
982 
984 <<<XML
985 <?xml version="1.0" encoding="UTF-8"?>
986 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
987  <vcalendar>
988  <properties>
989  <rdate>
990  <date-time>2008-02-05T19:12:24Z</date-time>
991  <date-time>2009-02-05T19:12:24Z</date-time>
992  </rdate>
993  </properties>
994  </vcalendar>
995 </icalendar>
996 XML
997 ,
998  'BEGIN:VCALENDAR' . "\n" .
999  'RDATE:20080205T191224Z,20090205T191224Z' . "\n" .
1000  'END:VCALENDAR' . "\n"
1001  );
1002 
1003  }
1004 
1005  function testRDateWithDate() {
1006 
1007  $this->assertXMLEqualsToMimeDir(
1008 <<<XML
1009 <?xml version="1.0" encoding="UTF-8"?>
1010 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
1011  <vcalendar>
1012  <properties>
1013  <rdate>
1014  <date>2008-10-06</date>
1015  </rdate>
1016  </properties>
1017  </vcalendar>
1018 </icalendar>
1019 XML
1020 ,
1021  'BEGIN:VCALENDAR' . "\n" .
1022  'RDATE:20081006' . "\n" .
1023  'END:VCALENDAR' . "\n"
1024  );
1025 
1026  $this->assertXMLEqualsToMimeDir(
1027 <<<XML
1028 <?xml version="1.0" encoding="UTF-8"?>
1029 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
1030  <vcalendar>
1031  <properties>
1032  <rdate>
1033  <date>2008-10-06</date>
1034  <date>2009-10-06</date>
1035  <date>2010-10-06</date>
1036  </rdate>
1037  </properties>
1038  </vcalendar>
1039 </icalendar>
1040 XML
1041 ,
1042  'BEGIN:VCALENDAR' . "\n" .
1043  'RDATE:20081006,20091006,20101006' . "\n" .
1044  'END:VCALENDAR' . "\n"
1045  );
1046 
1047  }
1048 
1049  function testRDateWithPeriod() {
1050 
1052 <<<XML
1053 <?xml version="1.0" encoding="UTF-8"?>
1054 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
1055  <vcalendar>
1056  <properties>
1057  <rdate>
1058  <parameters>
1059  <tzid>
1060  <text>US/Eastern</text>
1061  </tzid>
1062  </parameters>
1063  <period>
1064  <start>2006-01-02T15:00:00</start>
1065  <duration>PT2H</duration>
1066  </period>
1067  </rdate>
1068  </properties>
1069  </vcalendar>
1070 </icalendar>
1071 XML
1072 ,
1073  'BEGIN:VCALENDAR' . "\n" .
1074  'RDATE;TZID=US/Eastern;VALUE=PERIOD:20060102T150000/PT2H' . "\n" .
1075  'END:VCALENDAR' . "\n"
1076  );
1077 
1078  $this->assertXMLEqualsToMimeDir(
1079 <<<XML
1080 <?xml version="1.0" encoding="UTF-8"?>
1081 <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
1082  <vcalendar>
1083  <properties>
1084  <rdate>
1085  <parameters>
1086  <tzid>
1087  <text>US/Eastern</text>
1088  </tzid>
1089  </parameters>
1090  <period>
1091  <start>2006-01-02T15:00:00</start>
1092  <duration>PT2H</duration>
1093  </period>
1094  <period>
1095  <start>2008-01-02T15:00:00</start>
1096  <duration>PT1H</duration>
1097  </period>
1098  </rdate>
1099  </properties>
1100  </vcalendar>
1101 </icalendar>
1102 XML
1103 ,
1104  'BEGIN:VCALENDAR' . "\n" .
1105  'RDATE;TZID=US/Eastern;VALUE=PERIOD:20060102T150000/PT2H,20080102T150000/PT1' . "\n" .
1106  ' H' . "\n" .
1107  'END:VCALENDAR' . "\n"
1108  );
1109 
1110  }
1111 
1115  function testRFC6351Basic() {
1116 
1118 <<<XML
1119 <?xml version="1.0" encoding="UTF-8"?>
1120 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1121  <vcard>
1122  <fn>
1123  <text>J. Doe</text>
1124  </fn>
1125  <n>
1126  <surname>Doe</surname>
1127  <given>J.</given>
1128  <additional/>
1129  <prefix/>
1130  <suffix/>
1131  </n>
1132  </vcard>
1133 </vcards>
1134 XML
1135 ,
1136  'BEGIN:VCARD' . "\n" .
1137  'VERSION:4.0' . "\n" .
1138  'FN:J. Doe' . "\n" .
1139  'N:Doe;J.;;;' . "\n" .
1140  'END:VCARD' . "\n"
1141  );
1142 
1143  }
1144 
1148  function testRFC6351Example1() {
1149 
1151 <<<XML
1152 <?xml version="1.0" encoding="UTF-8"?>
1153 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1154  <vcard>
1155  <fn>
1156  <text>J. Doe</text>
1157  </fn>
1158  <n>
1159  <surname>Doe</surname>
1160  <given>J.</given>
1161  <additional/>
1162  <prefix/>
1163  <suffix/>
1164  </n>
1165  <x-file>
1166  <parameters>
1167  <mediatype>
1168  <text>image/jpeg</text>
1169  </mediatype>
1170  </parameters>
1171  <unknown>alien.jpg</unknown>
1172  </x-file>
1173  <x1:a href="http://www.example.com" xmlns:x1="http://www.w3.org/1999/xhtml">My web page!</x1:a>
1174  </vcard>
1175 </vcards>
1176 XML
1177 ,
1178  'BEGIN:VCARD' . "\n" .
1179  'VERSION:4.0' . "\n" .
1180  'FN:J. Doe' . "\n" .
1181  'N:Doe;J.;;;' . "\n" .
1182  'X-FILE;MEDIATYPE=image/jpeg:alien.jpg' . "\n" .
1183  'XML:<a xmlns="http://www.w3.org/1999/xhtml" href="http://www.example.com">M' . "\n" .
1184  ' y web page!</a>' . "\n" .
1185  'END:VCARD' . "\n"
1186  );
1187 
1188  }
1189 
1193  function testRFC6351Section5() {
1194 
1195  $this->assertXMLEqualsToMimeDir(
1196 <<<XML
1197 <?xml version="1.0" encoding="UTF-8"?>
1198 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1199  <vcard>
1200  <tel>
1201  <parameters>
1202  <type>
1203  <text>voice</text>
1204  <text>video</text>
1205  </type>
1206  </parameters>
1207  <uri>tel:+1-555-555-555</uri>
1208  </tel>
1209  </vcard>
1210 </vcards>
1211 XML
1212 ,
1213  'BEGIN:VCARD' . "\n" .
1214  'VERSION:4.0' . "\n" .
1215  'TEL;TYPE="voice,video":tel:+1-555-555-555' . "\n" .
1216  'END:VCARD' . "\n"
1217  );
1218 
1220 <<<XML
1221 <?xml version="1.0" encoding="UTF-8"?>
1222 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1223  <vcard>
1224  <tel>
1225  <parameters>
1226  <type>
1227  <text>voice</text>
1228  <text>video</text>
1229  </type>
1230  </parameters>
1231  <text>tel:+1-555-555-555</text>
1232  </tel>
1233  </vcard>
1234 </vcards>
1235 XML
1236 ,
1237  'BEGIN:VCARD' . "\n" .
1238  'VERSION:4.0' . "\n" .
1239  'TEL;TYPE="voice,video":tel:+1-555-555-555' . "\n" .
1240  'END:VCARD' . "\n"
1241  );
1242 
1243  }
1244 
1249 
1251 <<<XML
1252 <?xml version="1.0" encoding="UTF-8"?>
1253 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1254  <vcard>
1255  <tel>
1256  <text>tel:+1-555-555-556</text>
1257  </tel>
1258  <group name="contact">
1259  <tel>
1260  <text>tel:+1-555-555-555</text>
1261  </tel>
1262  <fn>
1263  <text>Gordon</text>
1264  </fn>
1265  </group>
1266  <group name="media">
1267  <fn>
1268  <text>Gordon</text>
1269  </fn>
1270  </group>
1271  </vcard>
1272 </vcards>
1273 XML
1274 ,
1275  'BEGIN:VCARD' . "\n" .
1276  'VERSION:4.0' . "\n" .
1277  'TEL:tel:+1-555-555-556' . "\n" .
1278  'contact.TEL:tel:+1-555-555-555' . "\n" .
1279  'contact.FN:Gordon' . "\n" .
1280  'media.FN:Gordon' . "\n" .
1281  'END:VCARD' . "\n"
1282  );
1283 
1284  }
1285 
1290 
1291  $this->assertXMLEqualsToMimeDir(
1292 <<<XML
1293 <?xml version="1.0" encoding="UTF-8"?>
1294 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1295  <vcard>
1296  <x-my-prop>
1297  <parameters>
1298  <pref>
1299  <integer>1</integer>
1300  </pref>
1301  </parameters>
1302  <text>value goes here</text>
1303  </x-my-prop>
1304  </vcard>
1305 </vcards>
1306 XML
1307 ,
1308  'BEGIN:VCARD' . "\n" .
1309  'VERSION:4.0' . "\n" .
1310  'X-MY-PROP;PREF=1:value goes here' . "\n" .
1311  'END:VCARD' . "\n"
1312  );
1313 
1314  }
1315 
1320 
1322 <<<XML
1323 <?xml version="1.0" encoding="UTF-8"?>
1324 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1325  <vcard>
1326  <bday>
1327  <date-and-or-time>20150128</date-and-or-time>
1328  </bday>
1329  </vcard>
1330 </vcards>
1331 XML
1332 ,
1333  'BEGIN:VCARD' . "\n" .
1334  'VERSION:4.0' . "\n" .
1335  'BDAY:20150128' . "\n" .
1336  'END:VCARD' . "\n"
1337  );
1338 
1339  }
1340 
1345 
1347 <<<XML
1348 <?xml version="1.0" encoding="UTF-8"?>
1349 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1350  <vcard>
1351  <bday>
1352  <date-and-or-time>2015-01</date-and-or-time>
1353  </bday>
1354  </vcard>
1355 </vcards>
1356 XML
1357 ,
1358  'BEGIN:VCARD' . "\n" .
1359  'VERSION:4.0' . "\n" .
1360  'BDAY:2015-01' . "\n" .
1361  'END:VCARD' . "\n"
1362  );
1363 
1364  }
1365 
1370 
1372 <<<XML
1373 <?xml version="1.0" encoding="UTF-8"?>
1374 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1375  <vcard>
1376  <bday>
1377  <date-and-or-time>--01</date-and-or-time>
1378  </bday>
1379  </vcard>
1380 </vcards>
1381 XML
1382 ,
1383  'BEGIN:VCARD' . "\n" .
1384  'VERSION:4.0' . "\n" .
1385  'BDAY:--01' . "\n" .
1386  'END:VCARD' . "\n"
1387  );
1388 
1389  }
1390 
1395 
1397 <<<XML
1398 <?xml version="1.0" encoding="UTF-8"?>
1399 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1400  <vcard>
1401  <bday>
1402  <date-and-or-time>--0128</date-and-or-time>
1403  </bday>
1404  </vcard>
1405 </vcards>
1406 XML
1407 ,
1408  'BEGIN:VCARD' . "\n" .
1409  'VERSION:4.0' . "\n" .
1410  'BDAY:--0128' . "\n" .
1411  'END:VCARD' . "\n"
1412  );
1413 
1414  }
1415 
1420 
1422 <<<XML
1423 <?xml version="1.0" encoding="UTF-8"?>
1424 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1425  <vcard>
1426  <bday>
1427  <date-and-or-time>---28</date-and-or-time>
1428  </bday>
1429  </vcard>
1430 </vcards>
1431 XML
1432 ,
1433  'BEGIN:VCARD' . "\n" .
1434  'VERSION:4.0' . "\n" .
1435  'BDAY:---28' . "\n" .
1436  'END:VCARD' . "\n"
1437  );
1438 
1439  }
1440 
1445 
1447 <<<XML
1448 <?xml version="1.0" encoding="UTF-8"?>
1449 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1450  <vcard>
1451  <bday>
1452  <date-and-or-time>13</date-and-or-time>
1453  </bday>
1454  </vcard>
1455 </vcards>
1456 XML
1457 ,
1458  'BEGIN:VCARD' . "\n" .
1459  'VERSION:4.0' . "\n" .
1460  'BDAY:13' . "\n" .
1461  'END:VCARD' . "\n"
1462  );
1463 
1464  }
1465 
1470 
1472 <<<XML
1473 <?xml version="1.0" encoding="UTF-8"?>
1474 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1475  <vcard>
1476  <bday>
1477  <date-and-or-time>1353</date-and-or-time>
1478  </bday>
1479  </vcard>
1480 </vcards>
1481 XML
1482 ,
1483  'BEGIN:VCARD' . "\n" .
1484  'VERSION:4.0' . "\n" .
1485  'BDAY:1353' . "\n" .
1486  'END:VCARD' . "\n"
1487  );
1488 
1489  }
1490 
1495 
1497 <<<XML
1498 <?xml version="1.0" encoding="UTF-8"?>
1499 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1500  <vcard>
1501  <bday>
1502  <date-and-or-time>135301</date-and-or-time>
1503  </bday>
1504  </vcard>
1505 </vcards>
1506 XML
1507 ,
1508  'BEGIN:VCARD' . "\n" .
1509  'VERSION:4.0' . "\n" .
1510  'BDAY:135301' . "\n" .
1511  'END:VCARD' . "\n"
1512  );
1513 
1514  }
1515 
1520 
1522 <<<XML
1523 <?xml version="1.0" encoding="UTF-8"?>
1524 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1525  <vcard>
1526  <bday>
1527  <date-and-or-time>-53</date-and-or-time>
1528  </bday>
1529  </vcard>
1530 </vcards>
1531 XML
1532 ,
1533  'BEGIN:VCARD' . "\n" .
1534  'VERSION:4.0' . "\n" .
1535  'BDAY:-53' . "\n" .
1536  'END:VCARD' . "\n"
1537  );
1538 
1539  }
1540 
1545 
1547 <<<XML
1548 <?xml version="1.0" encoding="UTF-8"?>
1549 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1550  <vcard>
1551  <bday>
1552  <date-and-or-time>-5301</date-and-or-time>
1553  </bday>
1554  </vcard>
1555 </vcards>
1556 XML
1557 ,
1558  'BEGIN:VCARD' . "\n" .
1559  'VERSION:4.0' . "\n" .
1560  'BDAY:-5301' . "\n" .
1561  'END:VCARD' . "\n"
1562  );
1563 
1564  }
1565 
1570 
1571  $this->assertTrue(true);
1572 
1573  /*
1574  * According to the Relax NG Schema, there is a conflict between
1575  * value-date and value-time. The --01 syntax can only match a
1576  * value-date because of the higher priority set in
1577  * value-date-and-or-time. So we basically skip this test.
1578  *
1579  $this->assertXMLReflexivelyEqualsToMimeDir(
1580 <<<XML
1581 <?xml version="1.0" encoding="UTF-8"?>
1582 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1583  <vcard>
1584  <bday>
1585  <date-and-or-time>--01</date-and-or-time>
1586  </bday>
1587  </vcard>
1588 </vcards>
1589 XML
1590 ,
1591  'BEGIN:VCARD' . "\n" .
1592  'VERSION:4.0' . "\n" .
1593  'BDAY:--01' . "\n" .
1594  'END:VCARD' . "\n"
1595  );
1596  */
1597 
1598  }
1599 
1604 
1606 <<<XML
1607 <?xml version="1.0" encoding="UTF-8"?>
1608 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1609  <vcard>
1610  <bday>
1611  <date-and-or-time>--01Z</date-and-or-time>
1612  </bday>
1613  </vcard>
1614 </vcards>
1615 XML
1616 ,
1617  'BEGIN:VCARD' . "\n" .
1618  'VERSION:4.0' . "\n" .
1619  'BDAY:--01Z' . "\n" .
1620  'END:VCARD' . "\n"
1621  );
1622 
1623  }
1624 
1629 
1631 <<<XML
1632 <?xml version="1.0" encoding="UTF-8"?>
1633 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1634  <vcard>
1635  <bday>
1636  <date-and-or-time>--01+1234</date-and-or-time>
1637  </bday>
1638  </vcard>
1639 </vcards>
1640 XML
1641 ,
1642  'BEGIN:VCARD' . "\n" .
1643  'VERSION:4.0' . "\n" .
1644  'BDAY:--01+1234' . "\n" .
1645  'END:VCARD' . "\n"
1646  );
1647 
1648  }
1649 
1654 
1656 <<<XML
1657 <?xml version="1.0" encoding="UTF-8"?>
1658 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1659  <vcard>
1660  <bday>
1661  <date-and-or-time>20150128T13</date-and-or-time>
1662  </bday>
1663  </vcard>
1664 </vcards>
1665 XML
1666 ,
1667  'BEGIN:VCARD' . "\n" .
1668  'VERSION:4.0' . "\n" .
1669  'BDAY:20150128T13' . "\n" .
1670  'END:VCARD' . "\n"
1671  );
1672 
1673  }
1674 
1679 
1681 <<<XML
1682 <?xml version="1.0" encoding="UTF-8"?>
1683 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1684  <vcard>
1685  <bday>
1686  <date-and-or-time>--0128T13</date-and-or-time>
1687  </bday>
1688  </vcard>
1689 </vcards>
1690 XML
1691 ,
1692  'BEGIN:VCARD' . "\n" .
1693  'VERSION:4.0' . "\n" .
1694  'BDAY:--0128T13' . "\n" .
1695  'END:VCARD' . "\n"
1696  );
1697 
1698  }
1699 
1704 
1706 <<<XML
1707 <?xml version="1.0" encoding="UTF-8"?>
1708 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1709  <vcard>
1710  <bday>
1711  <date-and-or-time>---28T13</date-and-or-time>
1712  </bday>
1713  </vcard>
1714 </vcards>
1715 XML
1716 ,
1717  'BEGIN:VCARD' . "\n" .
1718  'VERSION:4.0' . "\n" .
1719  'BDAY:---28T13' . "\n" .
1720  'END:VCARD' . "\n"
1721  );
1722 
1723  }
1724 
1729 
1731 <<<XML
1732 <?xml version="1.0" encoding="UTF-8"?>
1733 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1734  <vcard>
1735  <bday>
1736  <date-and-or-time>---28T1353</date-and-or-time>
1737  </bday>
1738  </vcard>
1739 </vcards>
1740 XML
1741 ,
1742  'BEGIN:VCARD' . "\n" .
1743  'VERSION:4.0' . "\n" .
1744  'BDAY:---28T1353' . "\n" .
1745  'END:VCARD' . "\n"
1746  );
1747 
1748  }
1749 
1754 
1756 <<<XML
1757 <?xml version="1.0" encoding="UTF-8"?>
1758 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1759  <vcard>
1760  <bday>
1761  <date-and-or-time>---28T135301</date-and-or-time>
1762  </bday>
1763  </vcard>
1764 </vcards>
1765 XML
1766 ,
1767  'BEGIN:VCARD' . "\n" .
1768  'VERSION:4.0' . "\n" .
1769  'BDAY:---28T135301' . "\n" .
1770  'END:VCARD' . "\n"
1771  );
1772 
1773  }
1774 
1779 
1781 <<<XML
1782 <?xml version="1.0" encoding="UTF-8"?>
1783 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1784  <vcard>
1785  <bday>
1786  <date-and-or-time>---28T13Z</date-and-or-time>
1787  </bday>
1788  </vcard>
1789 </vcards>
1790 XML
1791 ,
1792  'BEGIN:VCARD' . "\n" .
1793  'VERSION:4.0' . "\n" .
1794  'BDAY:---28T13Z' . "\n" .
1795  'END:VCARD' . "\n"
1796  );
1797 
1798  }
1799 
1804 
1806 <<<XML
1807 <?xml version="1.0" encoding="UTF-8"?>
1808 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1809  <vcard>
1810  <bday>
1811  <date-and-or-time>---28T13+1234</date-and-or-time>
1812  </bday>
1813  </vcard>
1814 </vcards>
1815 XML
1816 ,
1817  'BEGIN:VCARD' . "\n" .
1818  'VERSION:4.0' . "\n" .
1819  'BDAY:---28T13+1234' . "\n" .
1820  'END:VCARD' . "\n"
1821  );
1822 
1823  }
1824 
1829 
1831 <<<XML
1832 <?xml version="1.0" encoding="UTF-8"?>
1833 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1834  <vcard>
1835  <source>
1836  <uri>ldap://ldap.example.com/cn=Babs%20Jensen,%20o=Babsco,%20c=US</uri>
1837  </source>
1838  </vcard>
1839 </vcards>
1840 XML
1841 ,
1842  'BEGIN:VCARD' . "\n" .
1843  'VERSION:4.0' . "\n" .
1844  'SOURCE:ldap://ldap.example.com/cn=Babs%20Jensen\,%20o=Babsco\,%20c=US' . "\n" .
1845  'END:VCARD' . "\n"
1846  );
1847 
1848  }
1849 
1854 
1856 <<<XML
1857 <?xml version="1.0" encoding="UTF-8"?>
1858 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1859  <vcard>
1860  <kind>
1861  <text>individual</text>
1862  </kind>
1863  </vcard>
1864 </vcards>
1865 XML
1866 ,
1867  'BEGIN:VCARD' . "\n" .
1868  'VERSION:4.0' . "\n" .
1869  'KIND:individual' . "\n" .
1870  'END:VCARD' . "\n"
1871  );
1872 
1873  }
1874 
1879 
1881 <<<XML
1882 <?xml version="1.0" encoding="UTF-8"?>
1883 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1884  <vcard>
1885  <fn>
1886  <text>Mr. John Q. Public, Esq.</text>
1887  </fn>
1888  </vcard>
1889 </vcards>
1890 XML
1891 ,
1892  'BEGIN:VCARD' . "\n" .
1893  'VERSION:4.0' . "\n" .
1894  'FN:Mr. John Q. Public\, Esq.' . "\n" .
1895  'END:VCARD' . "\n"
1896  );
1897 
1898  }
1899 
1904 
1906 <<<XML
1907 <?xml version="1.0" encoding="UTF-8"?>
1908 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1909  <vcard>
1910  <n>
1911  <surname>Stevenson</surname>
1912  <given>John</given>
1913  <additional>Philip,Paul</additional>
1914  <prefix>Dr.</prefix>
1915  <suffix>Jr.,M.D.,A.C.P.</suffix>
1916  </n>
1917  </vcard>
1918 </vcards>
1919 XML
1920 ,
1921  'BEGIN:VCARD' . "\n" .
1922  'VERSION:4.0' . "\n" .
1923  'N:Stevenson;John;Philip\,Paul;Dr.;Jr.\,M.D.\,A.C.P.' . "\n" .
1924  'END:VCARD' . "\n"
1925  );
1926 
1927  }
1928 
1933 
1935 <<<XML
1936 <?xml version="1.0" encoding="UTF-8"?>
1937 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1938  <vcard>
1939  <nickname>
1940  <text>Jim</text>
1941  <text>Jimmie</text>
1942  </nickname>
1943  </vcard>
1944 </vcards>
1945 XML
1946 ,
1947  'BEGIN:VCARD' . "\n" .
1948  'VERSION:4.0' . "\n" .
1949  'NICKNAME:Jim,Jimmie' . "\n" .
1950  'END:VCARD' . "\n"
1951  );
1952 
1953  }
1954 
1959 
1961 <<<XML
1962 <?xml version="1.0" encoding="UTF-8"?>
1963 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1964  <vcard>
1965  <photo>
1966  <uri>http://www.example.com/pub/photos/jqpublic.gif</uri>
1967  </photo>
1968  </vcard>
1969 </vcards>
1970 XML
1971 ,
1972  'BEGIN:VCARD' . "\n" .
1973  'VERSION:4.0' . "\n" .
1974  'PHOTO:http://www.example.com/pub/photos/jqpublic.gif' . "\n" .
1975  'END:VCARD' . "\n"
1976  );
1977 
1978  }
1979 
1981 
1983 <<<XML
1984 <?xml version="1.0" encoding="UTF-8"?>
1985 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
1986  <vcard>
1987  <bday>
1988  <date-and-or-time>19531015T231000Z</date-and-or-time>
1989  </bday>
1990  </vcard>
1991 </vcards>
1992 XML
1993 ,
1994  'BEGIN:VCARD' . "\n" .
1995  'VERSION:4.0' . "\n" .
1996  'BDAY:19531015T231000Z' . "\n" .
1997  'END:VCARD' . "\n"
1998  );
1999 
2000  }
2001 
2003 
2005 <<<XML
2006 <?xml version="1.0" encoding="UTF-8"?>
2007 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2008  <vcard>
2009  <anniversary>
2010  <date-and-or-time>19960415</date-and-or-time>
2011  </anniversary>
2012  </vcard>
2013 </vcards>
2014 XML
2015 ,
2016  'BEGIN:VCARD' . "\n" .
2017  'VERSION:4.0' . "\n" .
2018  'ANNIVERSARY:19960415' . "\n" .
2019  'END:VCARD' . "\n"
2020  );
2021 
2022  }
2023 
2028 
2030 <<<XML
2031 <?xml version="1.0" encoding="UTF-8"?>
2032 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2033  <vcard>
2034  <gender>
2035  <sex>Jim</sex>
2036  <text>Jimmie</text>
2037  </gender>
2038  </vcard>
2039 </vcards>
2040 XML
2041 ,
2042  'BEGIN:VCARD' . "\n" .
2043  'VERSION:4.0' . "\n" .
2044  'GENDER:Jim;Jimmie' . "\n" .
2045  'END:VCARD' . "\n"
2046  );
2047 
2048  }
2049 
2054 
2056 <<<XML
2057 <?xml version="1.0" encoding="UTF-8"?>
2058 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2059  <vcard>
2060  <adr>
2061  <pobox/>
2062  <ext/>
2063  <street>123 Main Street</street>
2064  <locality>Any Town</locality>
2065  <region>CA</region>
2066  <code>91921-1234</code>
2067  <country>U.S.A.</country>
2068  </adr>
2069  </vcard>
2070 </vcards>
2071 XML
2072 ,
2073  'BEGIN:VCARD' . "\n" .
2074  'VERSION:4.0' . "\n" .
2075  'ADR:;;123 Main Street;Any Town;CA;91921-1234;U.S.A.' . "\n" .
2076  'END:VCARD' . "\n"
2077  );
2078 
2079  }
2080 
2085 
2096  $this->assertXMLEqualsToMimeDir(
2097 <<<XML
2098 <?xml version="1.0" encoding="UTF-8"?>
2099 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2100  <vcard>
2101  <tel>
2102  <parameters>
2103  <type>
2104  <text>home</text>
2105  </type>
2106  </parameters>
2107  <uri>tel:+33-01-23-45-67</uri>
2108  </tel>
2109  </vcard>
2110 </vcards>
2111 XML
2112 ,
2113  'BEGIN:VCARD' . "\n" .
2114  'VERSION:4.0' . "\n" .
2115  'TEL;TYPE=home:tel:+33-01-23-45-67' . "\n" .
2116  'END:VCARD' . "\n"
2117  );
2118 
2120 <<<XML
2121 <?xml version="1.0" encoding="UTF-8"?>
2122 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2123  <vcard>
2124  <tel>
2125  <parameters>
2126  <type>
2127  <text>home</text>
2128  </type>
2129  </parameters>
2130  <text>tel:+33-01-23-45-67</text>
2131  </tel>
2132  </vcard>
2133 </vcards>
2134 XML
2135 ,
2136  'BEGIN:VCARD' . "\n" .
2137  'VERSION:4.0' . "\n" .
2138  'TEL;TYPE=home:tel:+33-01-23-45-67' . "\n" .
2139  'END:VCARD' . "\n"
2140  );
2141 
2142  }
2143 
2148 
2150 <<<XML
2151 <?xml version="1.0" encoding="UTF-8"?>
2152 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2153  <vcard>
2154  <email>
2155  <parameters>
2156  <type>
2157  <text>work</text>
2158  </type>
2159  </parameters>
2160  <text>jqpublic@xyz.example.com</text>
2161  </email>
2162  </vcard>
2163 </vcards>
2164 XML
2165 ,
2166  'BEGIN:VCARD' . "\n" .
2167  'VERSION:4.0' . "\n" .
2168  'EMAIL;TYPE=work:jqpublic@xyz.example.com' . "\n" .
2169  'END:VCARD' . "\n"
2170  );
2171 
2172  }
2173 
2178 
2180 <<<XML
2181 <?xml version="1.0" encoding="UTF-8"?>
2182 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2183  <vcard>
2184  <impp>
2185  <parameters>
2186  <pref>
2187  <text>1</text>
2188  </pref>
2189  </parameters>
2190  <uri>xmpp:alice@example.com</uri>
2191  </impp>
2192  </vcard>
2193 </vcards>
2194 XML
2195 ,
2196  'BEGIN:VCARD' . "\n" .
2197  'VERSION:4.0' . "\n" .
2198  'IMPP;PREF=1:xmpp:alice@example.com' . "\n" .
2199  'END:VCARD' . "\n"
2200  );
2201 
2202  }
2203 
2208 
2210 <<<XML
2211 <?xml version="1.0" encoding="UTF-8"?>
2212 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2213  <vcard>
2214  <lang>
2215  <parameters>
2216  <type>
2217  <text>work</text>
2218  </type>
2219  <pref>
2220  <text>2</text>
2221  </pref>
2222  </parameters>
2223  <language-tag>en</language-tag>
2224  </lang>
2225  </vcard>
2226 </vcards>
2227 XML
2228 ,
2229  'BEGIN:VCARD' . "\n" .
2230  'VERSION:4.0' . "\n" .
2231  'LANG;TYPE=work;PREF=2:en' . "\n" .
2232  'END:VCARD' . "\n"
2233  );
2234 
2235  }
2236 
2241 
2243 <<<XML
2244 <?xml version="1.0" encoding="UTF-8"?>
2245 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2246  <vcard>
2247  <tz>
2248  <text>Raleigh/North America</text>
2249  </tz>
2250  </vcard>
2251 </vcards>
2252 XML
2253 ,
2254  'BEGIN:VCARD' . "\n" .
2255  'VERSION:4.0' . "\n" .
2256  'TZ:Raleigh/North America' . "\n" .
2257  'END:VCARD' . "\n"
2258  );
2259 
2260  }
2261 
2266 
2267  $this->assertXMLEqualsToMimeDir(
2268 <<<XML
2269 <?xml version="1.0" encoding="UTF-8"?>
2270 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2271  <vcard>
2272  <geo>
2273  <uri>geo:37.386013,-122.082932</uri>
2274  </geo>
2275  </vcard>
2276 </vcards>
2277 XML
2278 ,
2279  'BEGIN:VCARD' . "\n" .
2280  'VERSION:4.0' . "\n" .
2281  'GEO:geo:37.386013\,-122.082932' . "\n" .
2282  'END:VCARD' . "\n"
2283  );
2284 
2286 <<<XML
2287 <?xml version="1.0" encoding="UTF-8"?>
2288 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2289  <vcard>
2290  <geo>
2291  <text>geo:37.386013,-122.082932</text>
2292  </geo>
2293  </vcard>
2294 </vcards>
2295 XML
2296 ,
2297  'BEGIN:VCARD' . "\n" .
2298  'VERSION:4.0' . "\n" .
2299  'GEO:geo:37.386013\,-122.082932' . "\n" .
2300  'END:VCARD' . "\n"
2301  );
2302 
2303  }
2304 
2309 
2311 <<<XML
2312 <?xml version="1.0" encoding="UTF-8"?>
2313 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2314  <vcard>
2315  <title>
2316  <text>Research Scientist</text>
2317  </title>
2318  </vcard>
2319 </vcards>
2320 XML
2321 ,
2322  'BEGIN:VCARD' . "\n" .
2323  'VERSION:4.0' . "\n" .
2324  'TITLE:Research Scientist' . "\n" .
2325  'END:VCARD' . "\n"
2326  );
2327 
2328  }
2329 
2334 
2336 <<<XML
2337 <?xml version="1.0" encoding="UTF-8"?>
2338 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2339  <vcard>
2340  <role>
2341  <text>Project Leader</text>
2342  </role>
2343  </vcard>
2344 </vcards>
2345 XML
2346 ,
2347  'BEGIN:VCARD' . "\n" .
2348  'VERSION:4.0' . "\n" .
2349  'ROLE:Project Leader' . "\n" .
2350  'END:VCARD' . "\n"
2351  );
2352 
2353  }
2354 
2359 
2361 <<<XML
2362 <?xml version="1.0" encoding="UTF-8"?>
2363 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2364  <vcard>
2365  <logo>
2366  <uri>http://www.example.com/pub/logos/abccorp.jpg</uri>
2367  </logo>
2368  </vcard>
2369 </vcards>
2370 XML
2371 ,
2372  'BEGIN:VCARD' . "\n" .
2373  'VERSION:4.0' . "\n" .
2374  'LOGO:http://www.example.com/pub/logos/abccorp.jpg' . "\n" .
2375  'END:VCARD' . "\n"
2376  );
2377 
2378  }
2379 
2384 
2386 <<<XML
2387 <?xml version="1.0" encoding="UTF-8"?>
2388 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2389  <vcard>
2390  <org>
2391  <text>ABC, Inc.</text>
2392  <text>North American Division</text>
2393  <text>Marketing</text>
2394  </org>
2395  </vcard>
2396 </vcards>
2397 XML
2398 ,
2399  'BEGIN:VCARD' . "\n" .
2400  'VERSION:4.0' . "\n" .
2401  'ORG:ABC\, Inc.;North American Division;Marketing' . "\n" .
2402  'END:VCARD' . "\n"
2403  );
2404 
2405  }
2406 
2411 
2413 <<<XML
2414 <?xml version="1.0" encoding="UTF-8"?>
2415 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2416  <vcard>
2417  <member>
2418  <uri>urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af</uri>
2419  </member>
2420  </vcard>
2421 </vcards>
2422 XML
2423 ,
2424  'BEGIN:VCARD' . "\n" .
2425  'VERSION:4.0' . "\n" .
2426  'MEMBER:urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af' . "\n" .
2427  'END:VCARD' . "\n"
2428  );
2429 
2431 <<<XML
2432 <?xml version="1.0" encoding="UTF-8"?>
2433 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2434  <vcard>
2435  <member>
2436  <uri>mailto:subscriber1@example.com</uri>
2437  </member>
2438  <member>
2439  <uri>xmpp:subscriber2@example.com</uri>
2440  </member>
2441  <member>
2442  <uri>sip:subscriber3@example.com</uri>
2443  </member>
2444  <member>
2445  <uri>tel:+1-418-555-5555</uri>
2446  </member>
2447  </vcard>
2448 </vcards>
2449 XML
2450 ,
2451  'BEGIN:VCARD' . "\n" .
2452  'VERSION:4.0' . "\n" .
2453  'MEMBER:mailto:subscriber1@example.com' . "\n" .
2454  'MEMBER:xmpp:subscriber2@example.com' . "\n" .
2455  'MEMBER:sip:subscriber3@example.com' . "\n" .
2456  'MEMBER:tel:+1-418-555-5555' . "\n" .
2457  'END:VCARD' . "\n"
2458  );
2459 
2460  }
2461 
2466 
2468 <<<XML
2469 <?xml version="1.0" encoding="UTF-8"?>
2470 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2471  <vcard>
2472  <related>
2473  <parameters>
2474  <type>
2475  <text>friend</text>
2476  </type>
2477  </parameters>
2478  <uri>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6</uri>
2479  </related>
2480  </vcard>
2481 </vcards>
2482 XML
2483 ,
2484  'BEGIN:VCARD' . "\n" .
2485  'VERSION:4.0' . "\n" .
2486  'RELATED;TYPE=friend:urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6' . "\n" .
2487  'END:VCARD' . "\n"
2488  );
2489 
2490  }
2491 
2496 
2498 <<<XML
2499 <?xml version="1.0" encoding="UTF-8"?>
2500 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2501  <vcard>
2502  <categories>
2503  <text>INTERNET</text>
2504  <text>IETF</text>
2505  <text>INDUSTRY</text>
2506  <text>INFORMATION TECHNOLOGY</text>
2507  </categories>
2508  </vcard>
2509 </vcards>
2510 XML
2511 ,
2512  'BEGIN:VCARD' . "\n" .
2513  'VERSION:4.0' . "\n" .
2514  'CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY' . "\n" .
2515  'END:VCARD' . "\n"
2516  );
2517 
2518  }
2519 
2524 
2526 <<<XML
2527 <?xml version="1.0" encoding="UTF-8"?>
2528 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2529  <vcard>
2530  <note>
2531  <text>Foo, bar</text>
2532  </note>
2533  </vcard>
2534 </vcards>
2535 XML
2536 ,
2537  'BEGIN:VCARD' . "\n" .
2538  'VERSION:4.0' . "\n" .
2539  'NOTE:Foo\, bar' . "\n" .
2540  'END:VCARD' . "\n"
2541  );
2542 
2543  }
2544 
2549 
2551 <<<XML
2552 <?xml version="1.0" encoding="UTF-8"?>
2553 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2554  <vcard>
2555  <prodid>
2556  <text>-//ONLINE DIRECTORY//NONSGML Version 1//EN</text>
2557  </prodid>
2558  </vcard>
2559 </vcards>
2560 XML
2561 ,
2562  'BEGIN:VCARD' . "\n" .
2563  'VERSION:4.0' . "\n" .
2564  'PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN' . "\n" .
2565  'END:VCARD' . "\n"
2566  );
2567 
2568  }
2569 
2571 
2573 <<<XML
2574 <?xml version="1.0" encoding="UTF-8"?>
2575 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2576  <vcard>
2577  <rev>
2578  <timestamp>19951031T222710Z</timestamp>
2579  </rev>
2580  </vcard>
2581 </vcards>
2582 XML
2583 ,
2584  'BEGIN:VCARD' . "\n" .
2585  'VERSION:4.0' . "\n" .
2586  'REV:19951031T222710Z' . "\n" .
2587  'END:VCARD' . "\n"
2588  );
2589 
2590  }
2591 
2596 
2597  $this->assertXMLEqualsToMimeDir(
2598 <<<XML
2599 <?xml version="1.0" encoding="UTF-8"?>
2600 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2601  <vcard>
2602  <sound>
2603  <uri>CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@example.com</uri>
2604  </sound>
2605  </vcard>
2606 </vcards>
2607 XML
2608 ,
2609  'BEGIN:VCARD' . "\n" .
2610  'VERSION:4.0' . "\n" .
2611  'SOUND:CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@example.com' . "\n" .
2612  'END:VCARD' . "\n"
2613  );
2614 
2616 <<<XML
2617 <?xml version="1.0" encoding="UTF-8"?>
2618 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2619  <vcard>
2620  <sound>
2621  <text>CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@example.com</text>
2622  </sound>
2623  </vcard>
2624 </vcards>
2625 XML
2626 ,
2627  'BEGIN:VCARD' . "\n" .
2628  'VERSION:4.0' . "\n" .
2629  'SOUND:CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@example.com' . "\n" .
2630  'END:VCARD' . "\n"
2631  );
2632 
2633  }
2634 
2639 
2641 <<<XML
2642 <?xml version="1.0" encoding="UTF-8"?>
2643 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2644  <vcard>
2645  <uid>
2646  <text>urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6</text>
2647  </uid>
2648  </vcard>
2649 </vcards>
2650 XML
2651 ,
2652  'BEGIN:VCARD' . "\n" .
2653  'VERSION:4.0' . "\n" .
2654  'UID:urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6' . "\n" .
2655  'END:VCARD' . "\n"
2656  );
2657 
2658  }
2659 
2664 
2666 <<<XML
2667 <?xml version="1.0" encoding="UTF-8"?>
2668 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2669  <vcard>
2670  <clientpidmap>
2671  <sourceid>1</sourceid>
2672  <uri>urn:uuid:3df403f4-5924-4bb7-b077-3c711d9eb34b</uri>
2673  </clientpidmap>
2674  </vcard>
2675 </vcards>
2676 XML
2677 ,
2678  'BEGIN:VCARD' . "\n" .
2679  'VERSION:4.0' . "\n" .
2680  'CLIENTPIDMAP:1;urn:uuid:3df403f4-5924-4bb7-b077-3c711d9eb34b' . "\n" .
2681  'END:VCARD' . "\n"
2682  );
2683 
2684  }
2685 
2690 
2692 <<<XML
2693 <?xml version="1.0" encoding="UTF-8"?>
2694 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2695  <vcard>
2696  <url>
2697  <uri>http://example.org/restaurant.french/~chezchic.html</uri>
2698  </url>
2699  </vcard>
2700 </vcards>
2701 XML
2702 ,
2703  'BEGIN:VCARD' . "\n" .
2704  'VERSION:4.0' . "\n" .
2705  'URL:http://example.org/restaurant.french/~chezchic.html' . "\n" .
2706  'END:VCARD' . "\n"
2707  );
2708 
2709  }
2710 
2715 
2717 <<<XML
2718 <?xml version="1.0" encoding="UTF-8"?>
2719 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2720  <vcard/>
2721 </vcards>
2722 XML
2723 ,
2724  'BEGIN:VCARD' . "\n" .
2725  'VERSION:4.0' . "\n" .
2726  'END:VCARD' . "\n"
2727  );
2728 
2729  }
2730 
2735 
2737 <<<XML
2738 <?xml version="1.0" encoding="UTF-8"?>
2739 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2740  <vcard>
2741  <key>
2742  <parameters>
2743  <mediatype>
2744  <text>application/pgp-keys</text>
2745  </mediatype>
2746  </parameters>
2747  <text>ftp://example.com/keys/jdoe</text>
2748  </key>
2749  </vcard>
2750 </vcards>
2751 XML
2752 ,
2753  'BEGIN:VCARD' . "\n" .
2754  'VERSION:4.0' . "\n" .
2755  'KEY;MEDIATYPE=application/pgp-keys:ftp://example.com/keys/jdoe' . "\n" .
2756  'END:VCARD' . "\n"
2757  );
2758 
2759  }
2760 
2765 
2767 <<<XML
2768 <?xml version="1.0" encoding="UTF-8"?>
2769 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2770  <vcard>
2771  <fburl>
2772  <parameters>
2773  <pref>
2774  <text>1</text>
2775  </pref>
2776  </parameters>
2777  <uri>http://www.example.com/busy/janedoe</uri>
2778  </fburl>
2779  </vcard>
2780 </vcards>
2781 XML
2782 ,
2783  'BEGIN:VCARD' . "\n" .
2784  'VERSION:4.0' . "\n" .
2785  'FBURL;PREF=1:http://www.example.com/busy/janedoe' . "\n" .
2786  'END:VCARD' . "\n"
2787  );
2788 
2789  }
2790 
2795 
2797 <<<XML
2798 <?xml version="1.0" encoding="UTF-8"?>
2799 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2800  <vcard>
2801  <caladruri>
2802  <uri>http://example.com/calendar/jdoe</uri>
2803  </caladruri>
2804  </vcard>
2805 </vcards>
2806 XML
2807 ,
2808  'BEGIN:VCARD' . "\n" .
2809  'VERSION:4.0' . "\n" .
2810  'CALADRURI:http://example.com/calendar/jdoe' . "\n" .
2811  'END:VCARD' . "\n"
2812  );
2813 
2814  }
2815 
2820 
2822 <<<XML
2823 <?xml version="1.0" encoding="UTF-8"?>
2824 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2825  <vcard>
2826  <caluri>
2827  <parameters>
2828  <pref>
2829  <text>1</text>
2830  </pref>
2831  </parameters>
2832  <uri>http://cal.example.com/calA</uri>
2833  </caluri>
2834  </vcard>
2835 </vcards>
2836 XML
2837 ,
2838  'BEGIN:VCARD' . "\n" .
2839  'VERSION:4.0' . "\n" .
2840  'CALURI;PREF=1:http://cal.example.com/calA' . "\n" .
2841  'END:VCARD' . "\n"
2842  );
2843 
2844  }
2845 
2850 
2852 <<<XML
2853 <?xml version="1.0" encoding="UTF-8"?>
2854 <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
2855  <vcard>
2856  <capuri>
2857  <uri>http://cap.example.com/capA</uri>
2858  </capuri>
2859  </vcard>
2860 </vcards>
2861 XML
2862 ,
2863  'BEGIN:VCARD' . "\n" .
2864  'VERSION:4.0' . "\n" .
2865  'CAPURI:http://cap.example.com/capA' . "\n" .
2866  'END:VCARD' . "\n"
2867  );
2868 
2869  }
2870 
2875  protected function assertXMLEqualsToMimeDir($xml, $mimedir) {
2876 
2877  $component = VObject\Reader::readXML($xml);
2878  $this->assertVObjectEqualsVObject($mimedir, $component);
2879 
2880  }
2881 
2886  protected function assertXMLReflexivelyEqualsToMimeDir($xml, $mimedir) {
2887 
2888  $this->assertXMLEqualsToMimeDir($xml, $mimedir);
2889 
2890  $component = VObject\Reader::read($mimedir);
2891  $this->assertXmlStringEqualsXmlString($xml, VObject\Writer::writeXML($component));
2892 
2893  }
2894 }
testRFC6321Section3_4_1_2()
Properties, Special Cases, GEO.
Definition: XmlTest.php:331
testRFC6351ValueTimeWithHourMinute()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1469
testRFC6351ValueDateTimeWithDayHourZ()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1778
testRFC6321Section3_6_5()
Values, Date-Time.
Definition: XmlTest.php:601
testRFC6351Section5()
Design Considerations.
Definition: XmlTest.php:1193
testRFC6350Section6_2_4()
Property: PHOTO.
Definition: XmlTest.php:1958
testRFC6350Section6_3_1()
Property: ADR.
Definition: XmlTest.php:2053
testRFC6350Section6_1_4()
Property: KIND.
Definition: XmlTest.php:1853
testRFC6321Section3_6_8()
Values, Integer.
Definition: XmlTest.php:663
testRFC6351ValueDateWithYearMonthDay()
Section 4.3.1 of Relax NG Schema: value-date.
Definition: XmlTest.php:1319
testRFC6350Section6_6_2()
Property: ROLE.
Definition: XmlTest.php:2333
testRFC6350Section6_7_7()
Property: CLIENTPIDMAP.
Definition: XmlTest.php:2663
note()
Definition: note.php:2
testRFC6321Section3_6_1()
Values, Binary.
Definition: XmlTest.php:474
testRFC6351ValueDateTimeWithDayHourMinute()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1728
testRFC6321Section3_6_3()
Values, Calendar User Address.
Definition: XmlTest.php:549
testRFC6350Section6_7_9()
Property: VERSION.
Definition: XmlTest.php:2714
testRFC6351ValueTimeWithSecondZ()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1603
testRFC6350Section6_7_5()
Property: SOUND.
Definition: XmlTest.php:2595
testRFC6350Section6_9_3()
Property: CALURI.
Definition: XmlTest.php:2819
testRFC6350Section6_4_1()
Property: TEL.
Definition: XmlTest.php:2084
testRFC6350Section6_7_1()
Property: CATEGORIES.
Definition: XmlTest.php:2495
testRFC6321Section3_6_12()
Values, Time.
Definition: XmlTest.php:816
on($eventName, callable $callBack, $priority=100)
Subscribe to an event.
testRFC6351ValueDateTimeWithDayHourMinuteSecond()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1753
testRFC6321Section3_4_1_3()
Properties, Special Cases, REQUEST-STATUS.
Definition: XmlTest.php:358
testRFC6351ValueTimeWithSecond()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1569
testRFC6351Section5_1_NoNamespace()
Extensibility.
Definition: XmlTest.php:1289
testRFC6351ValueTimeWithSecondTZ()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1628
testRFC6350Section6_6_1()
Property: TITLE.
Definition: XmlTest.php:2308
testRFC6350Section6_5_2()
Property: GEO.
Definition: XmlTest.php:2265
testRFC6350Section6_4_3()
Property: IMPP.
Definition: XmlTest.php:2177
testRFC6351ValueTimeWithMinute()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1519
static write(Component $component)
Serializes a vCard or iCalendar object.
Definition: Writer.php:26
testRFC6350Section6_7_8()
Property: URL.
Definition: XmlTest.php:2689
testRFC6351ValueTimeWithHour()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1444
testRFC6351ValueDateWithMonth()
Section 4.3.1 of Relax NG Schema: value-date.
Definition: XmlTest.php:1369
testRFC6350Section6_2_1()
Property: FN.
Definition: XmlTest.php:1878
testRFC6350Section6_7_3()
Property: PRODID.
Definition: XmlTest.php:2548
testRFC6321Section3_6_6()
Values, Duration.
Definition: XmlTest.php:627
testRFC6351ValueDateTimeWithYearMonthDayHour()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1653
testRFC6350SectionA_3()
Property: CAPURI.
Definition: XmlTest.php:2849
testRFC6351ValueDateTimeWithMonthDayHour()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1678
all(array $promises)
This file contains a set of functions that are useful for dealing with the Promise object...
Definition: functions.php:32
static http()
Fetches the global http state from ILIAS.
testRFC6350Section6_5_1()
Property: TZ.
Definition: XmlTest.php:2240
testRFC6351Example1()
Example 1.
Definition: XmlTest.php:1148
testRFC6321Section3_6_10()
Values, Recurrence Rule.
Definition: XmlTest.php:759
hours($input)
Definition: memcachestat.php:7
testRFC6321Section3_2()
iCalendar Stream.
Definition: XmlTest.php:267
testRFC6350Section6_9_2()
Property: CALADRURI.
Definition: XmlTest.php:2794
testRFC6321Section3_6_4()
Values, Date.
Definition: XmlTest.php:575
testRFC6350Section6_6_4()
Property: ORG.
Definition: XmlTest.php:2383
testRFC6350Section6_9_1()
Property: FBURL.
Definition: XmlTest.php:2764
static readXML($data, $options=0)
Parses a xCard or xCal object, and returns the top component.
Definition: Reader.php:89
testRFC6350Section6_6_5()
Property: MEMBER.
Definition: XmlTest.php:2410
testRFC6350Section6_1_3()
Property: SOURCE.
Definition: XmlTest.php:1828
testRFC6350Section6_8_1()
Property: KEY.
Definition: XmlTest.php:2734
testRFC6351Section5Group()
Design Considerations.
Definition: XmlTest.php:1248
testRFC6321Section3_6_9()
Values, Period of Time.
Definition: XmlTest.php:708
testRFC6350Section6_2_2()
Property: N.
Definition: XmlTest.php:1903
testRFC6350Section6_2_7()
Property: GENDER.
Definition: XmlTest.php:2027
testRFC6351ValueDateWithMonthDay()
Section 4.3.1 of Relax NG Schema: value-date.
Definition: XmlTest.php:1394
testRFC6321Section3_6_7()
Values, Float.
Definition: XmlTest.php:653
testRFC6351ValueDateWithDay()
Section 4.3.1 of Relax NG Schema: value-date.
Definition: XmlTest.php:1419
XML Parser.
Definition: XML.php:21
testRFC6351Basic()
Basic example.
Definition: XmlTest.php:1115
assertXMLEqualsToMimeDir($xml, $mimedir)
Check this equality: XML -> object model -> MIME Dir.
Definition: XmlTest.php:2875
testRFC6321Section3_6_13()
Values, URI.
Definition: XmlTest.php:842
foreach($paths as $path) duplicate contact merge tool n
testRFC6321Section3_6_11()
Values, Text.
Definition: XmlTest.php:790
testRFC6351ValueDateTimeWithDayHour()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1703
testRFC6351ValueTimeWithMinuteSecond()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1544
testRFC6321Section3_6_2()
Values, Boolean.
Definition: XmlTest.php:520
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$this data['403_header']
testRFC6350Section6_6_3()
Property: LOGO.
Definition: XmlTest.php:2358
testRFC6351ValueTimeWithHourMinuteSecond()
Section 4.3.2 of Relax NG Schema: value-time.
Definition: XmlTest.php:1494
testRFC6350Section6_6_6()
Property: RELATED.
Definition: XmlTest.php:2465
testRFC6350Section6_2_3()
Property: NICKNAME.
Definition: XmlTest.php:1932
testRFC6351ValueDateTimeWithDayHourTZ()
Section 4.3.3 of Relax NG Schema: value-date-time.
Definition: XmlTest.php:1803
testRFC6321Section3_3()
All components exist.
Definition: XmlTest.php:285
testRFC6351ValueDateWithYearMonth()
Section 4.3.1 of Relax NG Schema: value-date.
Definition: XmlTest.php:1344
testRFC6321Section3_6_14()
Values, UTC Offset.
Definition: XmlTest.php:868
assertXMLReflexivelyEqualsToMimeDir($xml, $mimedir)
Check this (reflexive) equality: XML -> object model -> MIME Dir -> object model -> XML...
Definition: XmlTest.php:2886
testRFC6350Section6_7_6()
Property: UID.
Definition: XmlTest.php:2638
testRFC6350Section6_4_2()
Property: EMAIL.
Definition: XmlTest.php:2147
testRFC6350Section6_4_4()
Property: LANG.
Definition: XmlTest.php:2207
testRFC6350Section6_7_2()
Property: NOTE.
Definition: XmlTest.php:2523
testRFC6321Section5()
Handling Unrecognized Properties or Parameters.
Definition: XmlTest.php:915