CalendarQueryValidatorTest.php 20.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804
<?php

namespace Sabre\CalDAV;
use Sabre\VObject;
use Sabre\DAV;

class CalendarQueryValidatorTest extends \PHPUnit_Framework_TestCase {

    /**
     * @dataProvider provider
     */
    function testValid($icalObject, $filters, $outcome) {

        $validator = new CalendarQueryValidator();

        // Wrapping filter in a VCALENDAR component filter, as this is always
        // there anyway.
        $filters = array(
            'name' => 'VCALENDAR',
            'comp-filters' => array($filters),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => null,
        );

        $vObject = VObject\Reader::read($icalObject);

        switch($outcome) {
            case 0 :
                $this->assertFalse($validator->validate($vObject, $filters));
                break;
            case 1 :
                $this->assertTrue($validator->validate($vObject, $filters));
                break;
            case -1 :
                try {
                    $validator->validate($vObject, $filters);
                } catch (DAV\Exception $e) {
                    // Success
                } catch (\LogicException $e) {
                    // Success
                }
                break;

        }

    }

    function provider() {

        $blob1 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:hi
END:VEVENT
END:VCALENDAR
yow;

        $blob2 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:hi
BEGIN:VALARM
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob3 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
SUMMARY:hi
DTSTART;VALUE=DATE:20110704
END:VEVENT
END:VCALENDAR
yow;
        $blob4 = <<<yow
BEGIN:VCARD
VERSION:3.0
FN:Evert
END:VCARD
yow;

        $blob5 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DTEND:20110102T120000Z
END:VEVENT
END:VCALENDAR
yow;

        $blob6 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DURATION:PT5H
END:VEVENT
END:VCALENDAR
yow;

        $blob7 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;VALUE=DATE:20110101
END:VEVENT
END:VCALENDAR
yow;

        $blob8 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
END:VEVENT
END:VCALENDAR
yow;

        $blob9 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
DTSTART:20110101T120000Z
DURATION:PT1H
END:VTODO
END:VCALENDAR
yow;
        $blob10 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
DTSTART:20110101T120000Z
DUE:20110101T130000Z
END:VTODO
END:VCALENDAR
yow;
        $blob11 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
DTSTART:20110101T120000Z
END:VTODO
END:VCALENDAR
yow;

        $blob12 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
DUE:20110101T130000Z
END:VTODO
END:VCALENDAR
yow;

        $blob13 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
COMPLETED:20110101T130000Z
CREATED:20110101T110000Z
END:VTODO
END:VCALENDAR
yow;

        $blob14 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
COMPLETED:20110101T130000Z
END:VTODO
END:VCALENDAR
yow;

        $blob15 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
CREATED:20110101T110000Z
END:VTODO
END:VCALENDAR
yow;


        $blob16 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
END:VTODO
END:VCALENDAR
yow;

        $blob17 = <<<yow
BEGIN:VCALENDAR
BEGIN:VJOURNAL
END:VJOURNAL
END:VCALENDAR
yow;

        $blob18 = <<<yow
BEGIN:VCALENDAR
BEGIN:VJOURNAL
DTSTART:20110101T120000Z
END:VJOURNAL
END:VCALENDAR
yow;

        $blob19 = <<<yow
BEGIN:VCALENDAR
BEGIN:VJOURNAL
DTSTART;VALUE=DATE:20110101
END:VJOURNAL
END:VCALENDAR
yow;

        $blob20 = <<<yow
BEGIN:VCALENDAR
BEGIN:VFREEBUSY
END:VFREEBUSY
END:VCALENDAR
yow;

        $blob21 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
BEGIN:VALARM
TRIGGER:-PT1H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob22 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-PT1H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob23 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
BEGIN:VALARM
TRIGGER;VALUE=DURATION;RELATED=END:-PT1H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob24 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DTEND:20110101T130000Z
BEGIN:VALARM
TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob25 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DURATION:PT1H
BEGIN:VALARM
TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob26 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DURATION:PT1H
BEGIN:VALARM
TRIGGER;VALUE=DATE-TIME:20110101T110000Z
END:VALARM
END:VEVENT
END:VCALENDAR
yow;


        $blob27 = <<<yow
BEGIN:VCALENDAR
BEGIN:VTODO
DTSTART:20110101T120000Z
DUE:20110101T130000Z
BEGIN:VALARM
TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
END:VALARM
END:VTODO
END:VCALENDAR
yow;

        $blob28 = <<<yow
BEGIN:VCALENDAR
BEGIN:VJOURNAL
DTSTART:20110101T120000Z
BEGIN:VALARM
TRIGGER;VALUE=DURATION;RELATED=END:-PT2H
END:VALARM
END:VJOURNAL
END:VCALENDAR
yow;

        $blob29 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DURATION:PT1H
BEGIN:VALARM
TRIGGER;VALUE=DATE-TIME:20110101T090000Z
REPEAT:2
DURATION:PT1H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob30 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20110101T120000Z
DURATION:PT1H
BEGIN:VALARM
TRIGGER;VALUE=DATE-TIME:20110101T090000Z
DURATION:PT1H
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $blob31 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20080101T120000Z
DURATION:PT1H
RRULE:FREQ=YEARLY
END:VEVENT
END:VCALENDAR
yow;

        $blob32 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20080102T120000Z
DURATION:PT1H
RRULE:FREQ=YEARLY
END:VEVENT
END:VCALENDAR
yow;
        $blob33 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;VALUE=DATE:20120628
RRULE:FREQ=DAILY
END:VEVENT
END:VCALENDAR
yow;
        $blob34 = <<<yow
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;VALUE=DATE:20120628
RRULE:FREQ=DAILY
BEGIN:VALARM
TRIGGER:P52W
END:VALARM
END:VEVENT
END:VCALENDAR
yow;

        $filter1 = array(
            'name' => 'VEVENT',
            'comp-filters' => array(),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => null,
        );
        $filter2 = $filter1;
        $filter2['name'] = 'VTODO';

        $filter3 = $filter1;
        $filter3['is-not-defined'] = true;

        $filter4 = $filter1;
        $filter4['name'] = 'VTODO';
        $filter4['is-not-defined'] = true;

        $filter5 = $filter1;
        $filter5['comp-filters'] = array(
            array(
                'name' => 'VALARM',
                'is-not-defined' => false,
                'comp-filters' => array(),
                'prop-filters' => array(),
                'time-range' => null,
            ),
        );
        $filter6 = $filter1;
        $filter6['prop-filters'] = array(
            array(
                'name' => 'SUMMARY',
                'is-not-defined' => false,
                'param-filters' => array(),
                'time-range' => null,
                'text-match' => null,
            ),
        );
        $filter7 = $filter6;
        $filter7['prop-filters'][0]['name'] = 'DESCRIPTION';

        $filter8 = $filter6;
        $filter8['prop-filters'][0]['is-not-defined'] = true;

        $filter9 = $filter7;
        $filter9['prop-filters'][0]['is-not-defined'] = true;

        $filter10 = $filter5;
        $filter10['prop-filters'] = $filter6['prop-filters'];

        // Param filters
        $filter11 = $filter1;
        $filter11['prop-filters'] = array(
            array(
                'name' => 'DTSTART',
                'is-not-defined' => false,
                'param-filters' => array(
                    array(
                        'name' => 'VALUE',
                        'is-not-defined' => false,
                        'text-match' => null,
                    ),
                ),
                'time-range' => null,
                'text-match' => null,
            ),
        );

        $filter12 = $filter11;
        $filter12['prop-filters'][0]['param-filters'][0]['name'] = 'TZID';

        $filter13 = $filter11;
        $filter13['prop-filters'][0]['param-filters'][0]['is-not-defined'] = true;

        $filter14 = $filter12;
        $filter14['prop-filters'][0]['param-filters'][0]['is-not-defined'] = true;

        // Param text filter
        $filter15 = $filter11;
        $filter15['prop-filters'][0]['param-filters'][0]['text-match'] = array(
            'collation' => 'i;ascii-casemap',
            'value' => 'dAtE',
            'negate-condition' => false,
        );
        $filter16 = $filter15;
        $filter16['prop-filters'][0]['param-filters'][0]['text-match']['collation'] = 'i;octet';

        $filter17 = $filter15;
        $filter17['prop-filters'][0]['param-filters'][0]['text-match']['negate-condition'] = true;

        $filter18 = $filter15;
        $filter18['prop-filters'][0]['param-filters'][0]['text-match']['negate-condition'] = true;
        $filter18['prop-filters'][0]['param-filters'][0]['text-match']['collation'] = 'i;octet';

        // prop + text
        $filter19 = $filter5;
        $filter19['comp-filters'][0]['prop-filters'] = array(
            array(
                'name' => 'action',
                'is-not-defined' => false,
                'time-range' => null,
                'param-filters' => array(),
                'text-match' => array(
                    'collation' => 'i;ascii-casemap',
                    'value' => 'display',
                    'negate-condition' => false,
                ),
            ),
        );

        // Time range
        $filter20 = array(
            'name' => 'VEVENT',
            'comp-filters' => array(),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => array(
               'start' => new \DateTime('2011-01-01 10:00:00', new \DateTimeZone('GMT')),
               'end' => new \DateTime('2011-01-01 13:00:00', new \DateTimeZone('GMT')),
            ),
        );
        // Time range, no end date
        $filter21 = $filter20;
        $filter21['time-range']['end'] = null;

        // Time range, no start date
        $filter22 = $filter20;
        $filter22['time-range']['start'] = null;

        // Time range, other dates
        $filter23 = $filter20;
        $filter23['time-range'] = array(
           'start' => new \DateTime('2011-02-01 10:00:00', new \DateTimeZone('GMT')),
           'end' => new \DateTime('2011-02-01 13:00:00', new \DateTimeZone('GMT')),
        );
        // Time range
        $filter24 = array(
            'name' => 'VTODO',
            'comp-filters' => array(),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => array(
               'start' => new \DateTime('2011-01-01 12:45:00', new \DateTimeZone('GMT')),
               'end' => new \DateTime('2011-01-01 13:15:00', new \DateTimeZone('GMT')),
            ),
        );
        // Time range, other dates (1 month in the future)
        $filter25 = $filter24;
        $filter25['time-range'] = array(
           'start' => new \DateTime('2011-02-01 10:00:00', new \DateTimeZone('GMT')),
           'end' => new \DateTime('2011-02-01 13:00:00', new \DateTimeZone('GMT')),
        );
        $filter26 = $filter24;
        $filter26['time-range'] = array(
           'start' => new \DateTime('2011-01-01 11:45:00', new \DateTimeZone('GMT')),
           'end' => new \DateTime('2011-01-01 12:15:00', new \DateTimeZone('GMT')),
       );

        // Time range for VJOURNAL
        $filter27 = array(
            'name' => 'VJOURNAL',
            'comp-filters' => array(),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => array(
               'start' => new \DateTime('2011-01-01 12:45:00', new \DateTimeZone('GMT')),
               'end' => new \DateTime('2011-01-01 13:15:00', new \DateTimeZone('GMT')),
            ),
        );
        $filter28 = $filter27;
        $filter28['time-range'] = array(
           'start' => new \DateTime('2011-01-01 11:45:00', new \DateTimeZone('GMT')),
           'end' => new \DateTime('2011-01-01 12:15:00', new \DateTimeZone('GMT')),
        );
        // Time range for VFREEBUSY
        $filter29 = array(
            'name' => 'VFREEBUSY',
            'comp-filters' => array(),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => array(
               'start' => new \DateTime('2011-01-01 12:45:00', new \DateTimeZone('GMT')),
               'end' => new \DateTime('2011-01-01 13:15:00', new \DateTimeZone('GMT')),
            ),
        );
        // Time range filter on property
        $filter30 = array(
            'name' => 'VEVENT',
            'comp-filters' => array(),
            'prop-filters' => array(
                array(
                    'name' => 'DTSTART',
                    'is-not-defined' => false,
                    'param-filters' => array(),
                    'time-range' => array(
                       'start' => new \DateTime('2011-01-01 10:00:00', new \DateTimeZone('GMT')),
                       'end' => new \DateTime('2011-01-01 13:00:00', new \DateTimeZone('GMT')),
                   ),
                    'text-match' => null,
               ),
            ),
            'is-not-defined' => false,
            'time-range' => null,
        );

        // Time range for alarm
        $filter31 = array(
            'name' => 'VEVENT',
            'prop-filters' => array(),
            'comp-filters' => array(
                array(
                    'name' => 'VALARM',
                    'is-not-defined' => false,
                    'comp-filters' => array(),
                    'prop-filters' => array(),
                    'time-range' => array(
                       'start' => new \DateTime('2011-01-01 10:45:00', new \DateTimeZone('GMT')),
                       'end' => new \DateTime('2011-01-01 11:15:00', new \DateTimeZone('GMT')),
                    ),
                    'text-match' => null,
               ),
            ),
            'is-not-defined' => false,
            'time-range' => null,
        );
        $filter32 = $filter31;
        $filter32['comp-filters'][0]['time-range'] = array(
           'start' => new \DateTime('2011-01-01 11:45:00', new \DateTimeZone('GMT')),
           'end' => new \DateTime('2011-01-01 12:15:00', new \DateTimeZone('GMT')),
       );

        $filter33 = $filter31;
        $filter33['name'] = 'VTODO';
        $filter34 = $filter32;
        $filter34['name'] = 'VTODO';
        $filter35 = $filter31;
        $filter35['name'] = 'VJOURNAL';
        $filter36 = $filter32;
        $filter36['name'] = 'VJOURNAL';

        // Time range filter on non-datetime property
        $filter37 = array(
            'name' => 'VEVENT',
            'comp-filters' => array(),
            'prop-filters' => array(
                array(
                    'name' => 'SUMMARY',
                    'is-not-defined' => false,
                    'param-filters' => array(),
                    'time-range' => array(
                       'start' => new \DateTime('2011-01-01 10:00:00', new \DateTimeZone('GMT')),
                       'end' => new \DateTime('2011-01-01 13:00:00', new \DateTimeZone('GMT')),
                   ),
                    'text-match' => null,
               ),
            ),
            'is-not-defined' => false,
            'time-range' => null,
        );

        $filter38 = array(
            'name' => 'VEVENT',
            'comp-filters' => array(),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => array(
                'start' => new \DateTime('2012-07-01 00:00:00', new \DateTimeZone('UTC')),
                'end' => new \DateTime('2012-08-01 00:00:00', new \DateTimeZone('UTC')),
            )
        );
        $filter39 = array(
            'name' => 'VEVENT',
            'comp-filters' => array(
                array(
                    'name' => 'VALARM',
                    'comp-filters' => array(),
                    'prop-filters' => array(),
                    'is-not-defined' => false,
                    'time-range' => array(
                        'start' => new \DateTime('2012-09-01 00:00:00', new \DateTimeZone('UTC')),
                        'end' => new \DateTime('2012-10-01 00:00:00', new \DateTimeZone('UTC')),
                    )
                ),
            ),
            'prop-filters' => array(),
            'is-not-defined' => false,
            'time-range' => null,
        );

        return array(

            // Component check

            array($blob1, $filter1, 1),
            array($blob1, $filter2, 0),
            array($blob1, $filter3, 0),
            array($blob1, $filter4, 1),

            // Subcomponent check
            array($blob1, $filter5, 0),
            array($blob2, $filter5, 1),

            // Property check
            array($blob1, $filter6, 1),
            array($blob1, $filter7, 0),
            array($blob1, $filter8, 0),
            array($blob1, $filter9, 1),

            // Subcomponent + property
            array($blob2, $filter10, 1),

            // Param filter
            array($blob3, $filter11, 1),
            array($blob3, $filter12, 0),
            array($blob3, $filter13, 0),
            array($blob3, $filter14, 1),

            // Param + text
            array($blob3, $filter15, 1),
            array($blob3, $filter16, 0),
            array($blob3, $filter17, 0),
            array($blob3, $filter18, 1),

            // Prop + text
            array($blob2, $filter19, 1),

            // Incorrect object (vcard)
            array($blob4, $filter1, -1),

            // Time-range for event
            array($blob5, $filter20, 1),
            array($blob6, $filter20, 1),
            array($blob7, $filter20, 1),
            array($blob8, $filter20, 1),

            array($blob5, $filter21, 1),
            array($blob5, $filter22, 1),

            array($blob5, $filter23, 0),
            array($blob6, $filter23, 0),
            array($blob7, $filter23, 0),
            array($blob8, $filter23, 0),

            // Time-range for todo
            array($blob9, $filter24, 1),
            array($blob9, $filter25, 0),
            array($blob9, $filter26, 1),
            array($blob10, $filter24, 1),
            array($blob10, $filter25, 0),
            array($blob10, $filter26, 1),

            array($blob11, $filter24, 0),
            array($blob11, $filter25, 0),
            array($blob11, $filter26, 1),

            array($blob12, $filter24, 1),
            array($blob12, $filter25, 0),
            array($blob12, $filter26, 0),

            array($blob13, $filter24, 1),
            array($blob13, $filter25, 0),
            array($blob13, $filter26, 1),

            array($blob14, $filter24, 1),
            array($blob14, $filter25, 0),
            array($blob14, $filter26, 0),

            array($blob15, $filter24, 1),
            array($blob15, $filter25, 1),
            array($blob15, $filter26, 1),

            array($blob16, $filter24, 1),
            array($blob16, $filter25, 1),
            array($blob16, $filter26, 1),

            // Time-range for journals
            array($blob17, $filter27, 0),
            array($blob17, $filter28, 0),
            array($blob18, $filter27, 0),
            array($blob18, $filter28, 1),
            array($blob19, $filter27, 1),
            array($blob19, $filter28, 1),

            // Time-range for free-busy
            array($blob20, $filter29, -1),

            // Time-range on property
            array($blob5, $filter30, 1),
            array($blob3, $filter37, -1),
            array($blob3, $filter30, 0),

            // Time-range on alarm in vevent
            array($blob21, $filter31, 1),
            array($blob21, $filter32, 0),
            array($blob22, $filter31, 1),
            array($blob22, $filter32, 0),
            array($blob23, $filter31, 1),
            array($blob23, $filter32, 0),
            array($blob24, $filter31, 1),
            array($blob24, $filter32, 0),
            array($blob25, $filter31, 1),
            array($blob25, $filter32, 0),
            array($blob26, $filter31, 1),
            array($blob26, $filter32, 0),

            // Time-range on alarm for vtodo
            array($blob27, $filter33, 1),
            array($blob27, $filter34, 0),

            // Time-range on alarm for vjournal
            array($blob28, $filter35, -1),
            array($blob28, $filter36, -1),

            // Time-range on alarm with duration
            array($blob29, $filter31, 1),
            array($blob29, $filter32, 0),
            array($blob30, $filter31, 0),
            array($blob30, $filter32, 0),

            // Time-range with RRULE
            array($blob31, $filter20, 1),
            array($blob32, $filter20, 0),

            // Bug reported on mailing list, related to all-day events.
            array($blob33, $filter38, 1),

            // Event in timerange, but filtered alarm is in the far future.
            array($blob34, $filter39, 0),
        );

    }

}