Skip to content

Commit 17e9b47

Browse files
alecplphil-davis
authored andcommitted
Add PDO backend test
1 parent 962f0f4 commit 17e9b47

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,72 @@ public function testCalendarQueryTimeRangeNotSpecified()
942942
self::assertTrue(in_array('event2', $result));
943943
}
944944

945+
public function testCalendarQueryGH1000()
946+
{
947+
$backend = new PDO($this->pdo);
948+
$backend->createCalendarObject([1, 1], 'event1', <<<EOF
949+
BEGIN:VCALENDAR
950+
VERSION:2.0
951+
BEGIN:VEVENT
952+
UID:event1
953+
DTSTAMP:20120418T152519Z
954+
DTSTART;VALUE=DATE:20120330
955+
DTEND;VALUE=DATE:20120531
956+
SEQUENCE:1
957+
SUMMARY:Birthday1
958+
BEGIN:VALARM
959+
ACTION:EMAIL
960+
ATTENDEE:MAILTO:xxx@domain.de
961+
TRIGGER;VALUE=DATE-TIME:20120329T060000Z
962+
END:VALARM
963+
END:VEVENT
964+
END:VCALENDAR
965+
EOF
966+
);
967+
$backend->createCalendarObject([1, 1], 'event2', <<<EOF
968+
BEGIN:VCALENDAR
969+
VERSION:2.0
970+
BEGIN:VEVENT
971+
UID:event2
972+
DTSTAMP:20120418T152519Z
973+
DTSTART;VALUE=DATE:20120330
974+
DTEND;VALUE=DATE:20120531
975+
SEQUENCE:1
976+
SUMMARY:Birthday2
977+
END:VEVENT
978+
END:VCALENDAR
979+
EOF
980+
);
981+
982+
$filters = [
983+
'name' => 'VCALENDAR',
984+
'is-not-defined' => false,
985+
'comp-filters' => [
986+
[
987+
'name' => 'VEVENT',
988+
'is-not-defined' => false,
989+
'comp-filters' => [
990+
[
991+
'name' => 'VALARM',
992+
'is-not-defined' => true,
993+
'comp-filters' => [],
994+
'prop-filters' => [],
995+
'time-range' => null,
996+
],
997+
],
998+
'prop-filters' => [],
999+
'time-range' => false,
1000+
],
1001+
],
1002+
'prop-filters' => [],
1003+
'time-range' => null,
1004+
];
1005+
1006+
$result = $backend->calendarQuery([1, 1], $filters);
1007+
self::assertFalse(in_array('event1', $result));
1008+
self::assertTrue(in_array('event2', $result));
1009+
}
1010+
9451011
public function testGetChanges()
9461012
{
9471013
$backend = new PDO($this->pdo);

0 commit comments

Comments
 (0)