19 $this->assertFalse($validator->validate(
$vcal, [
'name' =>
'VFOO']));
29 function testValid($icalObject, $filters, $outcome) {
36 'name' =>
'VCALENDAR',
37 'comp-filters' => [$filters],
39 'is-not-defined' =>
false,
47 $this->assertFalse($validator->validate($vObject, $filters));
50 $this->assertTrue($validator->validate($vObject, $filters));
54 $validator->validate($vObject, $filters);
55 $this->fail(
'This test was supposed to fail');
59 $this->assertTrue(
true);
62 $this->assertTrue(
true);
95 DTSTART;VALUE=DATE:20110704
109 DTSTART:20110101T120000Z
110 DTEND:20110102T120000Z
118 DTSTART:20110101T120000Z
127 DTSTART;VALUE=DATE:20110101
135 DTSTART:20110101T120000Z
143 DTSTART:20110101T120000Z
151 DTSTART:20110101T120000Z
159 DTSTART:20110101T120000Z
176 CREATED:20110101T110000Z
192 CREATED:20110101T110000Z
215 DTSTART:20110101T120000Z
223 DTSTART;VALUE=DATE:20110101
238 DTSTART:20110101T120000Z
249 DTSTART:20110101T120000Z
251 TRIGGER;VALUE=DURATION:-PT1H
260 DTSTART:20110101T120000Z
262 TRIGGER;VALUE=DURATION;RELATED=END:-PT1H
271 DTSTART:20110101T120000Z
272 DTEND:20110101T130000Z
274 TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
283 DTSTART:20110101T120000Z
286 TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
295 DTSTART:20110101T120000Z
298 TRIGGER;VALUE=DATE-TIME:20110101T110000Z
308 DTSTART:20110101T120000Z
311 TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
320 DTSTART:20110101T120000Z
322 TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
331 DTSTART:20110101T120000Z
334 TRIGGER;VALUE=DATE-TIME:20110101T090000Z
345 DTSTART:20110101T120000Z
348 TRIGGER;VALUE=DATE-TIME:20110101T090000Z
359 DTSTART:20080101T120000Z
370 DTSTART:20080102T120000Z
380 DTSTART;VALUE=DATE:20120628
389 DTSTART;VALUE=DATE:20120628
400 'comp-filters' => [],
401 'prop-filters' => [],
402 'is-not-defined' =>
false,
403 'time-range' => null,
406 $filter2[
'name'] =
'VTODO';
409 $filter3[
'is-not-defined'] =
true;
412 $filter4[
'name'] =
'VTODO';
413 $filter4[
'is-not-defined'] =
true;
416 $filter5[
'comp-filters'] = [
419 'is-not-defined' =>
false,
420 'comp-filters' => [],
421 'prop-filters' => [],
422 'time-range' => null,
426 $filter6[
'prop-filters'] = [
429 'is-not-defined' =>
false,
430 'param-filters' => [],
431 'time-range' => null,
432 'text-match' => null,
436 $filter7[
'prop-filters'][0][
'name'] =
'DESCRIPTION';
439 $filter8[
'prop-filters'][0][
'is-not-defined'] =
true;
442 $filter9[
'prop-filters'][0][
'is-not-defined'] =
true;
444 $filter10 = $filter5;
445 $filter10[
'prop-filters'] = $filter6[
'prop-filters'];
448 $filter11 = $filter1;
449 $filter11[
'prop-filters'] = [
452 'is-not-defined' =>
false,
456 'is-not-defined' =>
false,
457 'text-match' => null,
460 'time-range' => null,
461 'text-match' => null,
465 $filter12 = $filter11;
466 $filter12[
'prop-filters'][0][
'param-filters'][0][
'name'] =
'TZID';
468 $filter13 = $filter11;
469 $filter13[
'prop-filters'][0][
'param-filters'][0][
'is-not-defined'] =
true;
471 $filter14 = $filter12;
472 $filter14[
'prop-filters'][0][
'param-filters'][0][
'is-not-defined'] =
true;
475 $filter15 = $filter11;
476 $filter15[
'prop-filters'][0][
'param-filters'][0][
'text-match'] = [
477 'collation' =>
'i;ascii-casemap',
479 'negate-condition' =>
false,
481 $filter16 = $filter15;
482 $filter16[
'prop-filters'][0][
'param-filters'][0][
'text-match'][
'collation'] =
'i;octet';
484 $filter17 = $filter15;
485 $filter17[
'prop-filters'][0][
'param-filters'][0][
'text-match'][
'negate-condition'] =
true;
487 $filter18 = $filter15;
488 $filter18[
'prop-filters'][0][
'param-filters'][0][
'text-match'][
'negate-condition'] =
true;
489 $filter18[
'prop-filters'][0][
'param-filters'][0][
'text-match'][
'collation'] =
'i;octet';
492 $filter19 = $filter5;
493 $filter19[
'comp-filters'][0][
'prop-filters'] = [
496 'is-not-defined' =>
false,
497 'time-range' => null,
498 'param-filters' => [],
500 'collation' =>
'i;ascii-casemap',
501 'value' =>
'display',
502 'negate-condition' =>
false,
510 'comp-filters' => [],
511 'prop-filters' => [],
512 'is-not-defined' =>
false,
514 'start' => new \DateTime(
'2011-01-01 10:00:00',
new \
DateTimeZone(
'GMT')),
515 'end' => new \DateTime(
'2011-01-01 13:00:00',
new \
DateTimeZone(
'GMT')),
519 $filter21 = $filter20;
520 $filter21[
'time-range'][
'end'] = null;
523 $filter22 = $filter20;
524 $filter22[
'time-range'][
'start'] = null;
527 $filter23 = $filter20;
528 $filter23[
'time-range'] = [
529 'start' => new \DateTime(
'2011-02-01 10:00:00',
new \
DateTimeZone(
'GMT')),
530 'end' => new \DateTime(
'2011-02-01 13:00:00',
new \
DateTimeZone(
'GMT')),
535 'comp-filters' => [],
536 'prop-filters' => [],
537 'is-not-defined' =>
false,
539 'start' => new \DateTime(
'2011-01-01 12:45:00',
new \
DateTimeZone(
'GMT')),
540 'end' => new \DateTime(
'2011-01-01 13:15:00',
new \
DateTimeZone(
'GMT')),
544 $filter25 = $filter24;
545 $filter25[
'time-range'] = [
546 'start' => new \DateTime(
'2011-02-01 10:00:00',
new \
DateTimeZone(
'GMT')),
547 'end' => new \DateTime(
'2011-02-01 13:00:00',
new \
DateTimeZone(
'GMT')),
549 $filter26 = $filter24;
550 $filter26[
'time-range'] = [
551 'start' => new \DateTime(
'2011-01-01 11:45:00',
new \
DateTimeZone(
'GMT')),
552 'end' => new \DateTime(
'2011-01-01 12:15:00',
new \
DateTimeZone(
'GMT')),
557 'name' =>
'VJOURNAL',
558 'comp-filters' => [],
559 'prop-filters' => [],
560 'is-not-defined' =>
false,
562 'start' => new \DateTime(
'2011-01-01 12:45:00',
new \
DateTimeZone(
'GMT')),
563 'end' => new \DateTime(
'2011-01-01 13:15:00',
new \
DateTimeZone(
'GMT')),
566 $filter28 = $filter27;
567 $filter28[
'time-range'] = [
568 'start' => new \DateTime(
'2011-01-01 11:45:00',
new \
DateTimeZone(
'GMT')),
569 'end' => new \DateTime(
'2011-01-01 12:15:00',
new \
DateTimeZone(
'GMT')),
573 'name' =>
'VFREEBUSY',
574 'comp-filters' => [],
575 'prop-filters' => [],
576 'is-not-defined' =>
false,
578 'start' => new \DateTime(
'2011-01-01 12:45:00',
new \
DateTimeZone(
'GMT')),
579 'end' => new \DateTime(
'2011-01-01 13:15:00',
new \
DateTimeZone(
'GMT')),
585 'comp-filters' => [],
589 'is-not-defined' =>
false,
590 'param-filters' => [],
592 'start' => new \DateTime(
'2011-01-01 10:00:00',
new \
DateTimeZone(
'GMT')),
593 'end' => new \DateTime(
'2011-01-01 13:00:00',
new \
DateTimeZone(
'GMT')),
595 'text-match' => null,
598 'is-not-defined' =>
false,
599 'time-range' => null,
605 'prop-filters' => [],
609 'is-not-defined' =>
false,
610 'comp-filters' => [],
611 'prop-filters' => [],
613 'start' => new \DateTime(
'2011-01-01 10:45:00',
new \
DateTimeZone(
'GMT')),
614 'end' => new \DateTime(
'2011-01-01 11:15:00',
new \
DateTimeZone(
'GMT')),
616 'text-match' => null,
619 'is-not-defined' =>
false,
620 'time-range' => null,
622 $filter32 = $filter31;
623 $filter32[
'comp-filters'][0][
'time-range'] = [
624 'start' => new \DateTime(
'2011-01-01 11:45:00',
new \
DateTimeZone(
'GMT')),
625 'end' => new \DateTime(
'2011-01-01 12:15:00',
new \
DateTimeZone(
'GMT')),
628 $filter33 = $filter31;
629 $filter33[
'name'] =
'VTODO';
630 $filter34 = $filter32;
631 $filter34[
'name'] =
'VTODO';
632 $filter35 = $filter31;
633 $filter35[
'name'] =
'VJOURNAL';
634 $filter36 = $filter32;
635 $filter36[
'name'] =
'VJOURNAL';
640 'comp-filters' => [],
644 'is-not-defined' =>
false,
645 'param-filters' => [],
647 'start' => new \DateTime(
'2011-01-01 10:00:00',
new \
DateTimeZone(
'GMT')),
648 'end' => new \DateTime(
'2011-01-01 13:00:00',
new \
DateTimeZone(
'GMT')),
650 'text-match' => null,
653 'is-not-defined' =>
false,
654 'time-range' => null,
659 'comp-filters' => [],
660 'prop-filters' => [],
661 'is-not-defined' =>
false,
663 'start' => new \DateTime(
'2012-07-01 00:00:00',
new \
DateTimeZone(
'UTC')),
664 'end' => new \DateTime(
'2012-08-01 00:00:00',
new \
DateTimeZone(
'UTC')),
672 'comp-filters' => [],
673 'prop-filters' => [],
674 'is-not-defined' =>
false,
676 'start' => new \DateTime(
'2012-09-01 00:00:00',
new \
DateTimeZone(
'UTC')),
677 'end' => new \DateTime(
'2012-10-01 00:00:00',
new \
DateTimeZone(
'UTC')),
681 'prop-filters' => [],
682 'is-not-defined' =>
false,
683 'time-range' => null,
690 [$blob1, $filter1, 1],
691 [$blob1, $filter2, 0],
692 [$blob1, $filter3, 0],
693 [$blob1, $filter4, 1],
696 [$blob1, $filter5, 0],
697 [$blob2, $filter5, 1],
700 [$blob1, $filter6, 1],
701 [$blob1, $filter7, 0],
702 [$blob1, $filter8, 0],
703 [$blob1, $filter9, 1],
706 [$blob2, $filter10, 1],
709 [$blob3, $filter11, 1],
710 [$blob3, $filter12, 0],
711 [$blob3, $filter13, 0],
712 [$blob3, $filter14, 1],
715 [$blob3, $filter15, 1],
716 [$blob3, $filter16, 0],
717 [$blob3, $filter17, 0],
718 [$blob3, $filter18, 1],
721 [$blob2, $filter19, 1],
724 [$blob4, $filter1, -1],
727 [$blob5, $filter20, 1],
728 [$blob6, $filter20, 1],
729 [$blob7, $filter20, 1],
730 [$blob8, $filter20, 1],
732 [$blob5, $filter21, 1],
733 [$blob5, $filter22, 1],
735 [$blob5, $filter23, 0],
736 [$blob6, $filter23, 0],
737 [$blob7, $filter23, 0],
738 [$blob8, $filter23, 0],
741 [$blob9, $filter24, 1],
742 [$blob9, $filter25, 0],
743 [$blob9, $filter26, 1],
744 [$blob10, $filter24, 1],
745 [$blob10, $filter25, 0],
746 [$blob10, $filter26, 1],
748 [$blob11, $filter24, 0],
749 [$blob11, $filter25, 0],
750 [$blob11, $filter26, 1],
752 [$blob12, $filter24, 1],
753 [$blob12, $filter25, 0],
754 [$blob12, $filter26, 0],
756 [$blob13, $filter24, 1],
757 [$blob13, $filter25, 0],
758 [$blob13, $filter26, 1],
760 [$blob14, $filter24, 1],
761 [$blob14, $filter25, 0],
762 [$blob14, $filter26, 0],
764 [$blob15, $filter24, 1],
765 [$blob15, $filter25, 1],
766 [$blob15, $filter26, 1],
768 [$blob16, $filter24, 1],
769 [$blob16, $filter25, 1],
770 [$blob16, $filter26, 1],
773 [$blob17, $filter27, 0],
774 [$blob17, $filter28, 0],
775 [$blob18, $filter27, 0],
776 [$blob18, $filter28, 1],
777 [$blob19, $filter27, 1],
778 [$blob19, $filter28, 1],
781 [$blob20, $filter29, -1],
784 [$blob5, $filter30, 1],
785 [$blob3, $filter37, -1],
786 [$blob3, $filter30, 0],
789 [$blob21, $filter31, 1],
790 [$blob21, $filter32, 0],
791 [$blob22, $filter31, 1],
792 [$blob22, $filter32, 0],
793 [$blob23, $filter31, 1],
794 [$blob23, $filter32, 0],
795 [$blob24, $filter31, 1],
796 [$blob24, $filter32, 0],
797 [$blob25, $filter31, 1],
798 [$blob25, $filter32, 0],
799 [$blob26, $filter31, 1],
800 [$blob26, $filter32, 0],
803 [$blob27, $filter33, 1],
804 [$blob27, $filter34, 0],
807 [$blob28, $filter35, -1],
808 [$blob28, $filter36, -1],
811 [$blob29, $filter31, 1],
812 [$blob29, $filter32, 0],
813 [$blob30, $filter31, 0],
814 [$blob30, $filter32, 0],
817 [$blob31, $filter20, 1],
818 [$blob32, $filter20, 0],
824 [$blob34, $filter39, 0],
testValid($icalObject, $filters, $outcome)
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.