diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-11 05:54:20 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-11 05:54:20 -0400 |
commit | d968fc51eab8b0fb259ecbeae517056b99554017 (patch) | |
tree | 10e551cff9fefbefbfd7e5031b57320116bb7fce /vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php | |
parent | c7698e4dc388b7d9a9db368672cb057c1d4d3a01 (diff) | |
parent | 4dd3839c41e18d9724855e7955d8737b6f52dcd6 (diff) | |
download | volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.gz volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.bz2 volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.zip |
Merge remote-tracking branch 'upstream/dev' into plugin-repo
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php index deb70d205..9822e82e2 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/CalendarQueryValidatorTest.php @@ -6,6 +6,20 @@ use Sabre\DAV; class CalendarQueryValidatorTest extends \PHPUnit_Framework_TestCase { + function testTopLevelFail() { + + $validator = new CalendarQueryValidator(); + $vcal = <<<ICS +BEGIN:VCALENDAR +BEGIN:VEVENT +END:VEVENT +END:VCALENDAR +ICS; + $vcal = VObject\Reader::read($vcal); + $this->assertFalse($validator->validate($vcal, ['name' => 'VFOO'])); + + } + /** * @dataProvider provider */ @@ -35,10 +49,14 @@ class CalendarQueryValidatorTest extends \PHPUnit_Framework_TestCase { case -1 : try { $validator->validate($vObject, $filters); - } catch (DAV\Exception $e) { - // Success - } catch (\LogicException $e) { - // Success + $this->fail('This test was supposed to fail'); + } catch (\Exception $e) { + // We need to test something to be valid for phpunit strict + // mode. + $this->assertTrue(true); + } catch (\Throwable $e) { + // PHP7 + $this->assertTrue(true); } break; @@ -334,6 +352,7 @@ yow; $blob31 = <<<yow BEGIN:VCALENDAR BEGIN:VEVENT +UID:foobar DTSTART:20080101T120000Z DURATION:PT1H RRULE:FREQ=YEARLY @@ -344,6 +363,7 @@ yow; $blob32 = <<<yow BEGIN:VCALENDAR BEGIN:VEVENT +UID:foobar DTSTART:20080102T120000Z DURATION:PT1H RRULE:FREQ=YEARLY @@ -353,6 +373,7 @@ yow; $blob33 = <<<yow BEGIN:VCALENDAR BEGIN:VEVENT +UID:foobar DTSTART;VALUE=DATE:20120628 RRULE:FREQ=DAILY END:VEVENT @@ -361,6 +382,7 @@ yow; $blob34 = <<<yow BEGIN:VCALENDAR BEGIN:VEVENT +UID:foobar DTSTART;VALUE=DATE:20120628 RRULE:FREQ=DAILY BEGIN:VALARM @@ -667,38 +689,38 @@ yow; array($blob1, $filter3, 0), array($blob1, $filter4, 1), - // Subcomponent check + // Subcomponent check (4) array($blob1, $filter5, 0), array($blob2, $filter5, 1), - // Property check + // Property checki (6) array($blob1, $filter6, 1), array($blob1, $filter7, 0), array($blob1, $filter8, 0), array($blob1, $filter9, 1), - // Subcomponent + property + // Subcomponent + property (10) array($blob2, $filter10, 1), - // Param filter + // Param filter (11) array($blob3, $filter11, 1), array($blob3, $filter12, 0), array($blob3, $filter13, 0), array($blob3, $filter14, 1), - // Param + text + // Param + text (15) array($blob3, $filter15, 1), array($blob3, $filter16, 0), array($blob3, $filter17, 0), array($blob3, $filter18, 1), - // Prop + text + // Prop + text (19) array($blob2, $filter19, 1), - // Incorrect object (vcard) + // Incorrect object (vcard) (20) array($blob4, $filter1, -1), - // Time-range for event + // Time-range for event (21) array($blob5, $filter20, 1), array($blob6, $filter20, 1), array($blob7, $filter20, 1), @@ -712,7 +734,7 @@ yow; array($blob7, $filter23, 0), array($blob8, $filter23, 0), - // Time-range for todo + // Time-range for todo (31) array($blob9, $filter24, 1), array($blob9, $filter25, 0), array($blob9, $filter26, 1), @@ -744,7 +766,7 @@ yow; array($blob16, $filter25, 1), array($blob16, $filter26, 1), - // Time-range for journals + // Time-range for journals (55) array($blob17, $filter27, 0), array($blob17, $filter28, 0), array($blob18, $filter27, 0), @@ -752,15 +774,15 @@ yow; array($blob19, $filter27, 1), array($blob19, $filter28, 1), - // Time-range for free-busy + // Time-range for free-busy (61) array($blob20, $filter29, -1), - // Time-range on property + // Time-range on property (62) array($blob5, $filter30, 1), array($blob3, $filter37, -1), array($blob3, $filter30, 0), - // Time-range on alarm in vevent + // Time-range on alarm in vevent (65) array($blob21, $filter31, 1), array($blob21, $filter32, 0), array($blob22, $filter31, 1), @@ -774,28 +796,28 @@ yow; array($blob26, $filter31, 1), array($blob26, $filter32, 0), - // Time-range on alarm for vtodo + // Time-range on alarm for vtodo (77) array($blob27, $filter33, 1), array($blob27, $filter34, 0), - // Time-range on alarm for vjournal + // Time-range on alarm for vjournal (79) array($blob28, $filter35, -1), array($blob28, $filter36, -1), - // Time-range on alarm with duration + // Time-range on alarm with duration (81) array($blob29, $filter31, 1), array($blob29, $filter32, 0), array($blob30, $filter31, 0), array($blob30, $filter32, 0), - // Time-range with RRULE + // Time-range with RRULE (85) array($blob31, $filter20, 1), array($blob32, $filter20, 0), - // Bug reported on mailing list, related to all-day events. - array($blob33, $filter38, 1), + // Bug reported on mailing list, related to all-day events (87) + //array($blob33, $filter38, 1), - // Event in timerange, but filtered alarm is in the far future. + // Event in timerange, but filtered alarm is in the far future (88). array($blob34, $filter39, 0), ); |