Skip to content

Commit

Permalink
Split out fixtures.
Browse files Browse the repository at this point in the history
Refs: PR #140
  • Loading branch information
yunosh committed Jun 26, 2015
1 parent 7436564 commit 9ced8c8
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 105 deletions.
12 changes: 10 additions & 2 deletions framework/Icalendar/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<email>mrubinsk@horde.org</email>
<active>yes</active>
</developer>
<date>2015-06-18</date>
<date>2015-06-26</date>
<version>
<release>2.1.1</release>
<api>2.1.0</api>
Expand Down Expand Up @@ -394,6 +394,10 @@
<file name="multiple-summary.ics" role="test" />
<file name="org.vcf" role="test" />
<file name="quoted-params.ics" role="test" />
<file name="timezone1.ics" role="test" />
<file name="timezone2.ics" role="test" />
<file name="timezone3.ics" role="test" />
<file name="timezone4.ics" role="test" />
<file name="vcal20.ics" role="test" />
<file name="vfreebusy1.ics" role="test" />
<file name="vfreebusy2.ics" role="test" />
Expand Down Expand Up @@ -610,6 +614,10 @@
<install as="Horde/Icalendar/fixtures/multiple-summary.ics" name="test/Horde/Icalendar/fixtures/multiple-summary.ics" />
<install as="Horde/Icalendar/fixtures/org.vcf" name="test/Horde/Icalendar/fixtures/org.vcf" />
<install as="Horde/Icalendar/fixtures/quoted-params.ics" name="test/Horde/Icalendar/fixtures/quoted-params.ics" />
<install as="Horde/Icalendar/fixtures/timezone1.ics" name="test/Horde/Icalendar/fixtures/timezone1.ics" />
<install as="Horde/Icalendar/fixtures/timezone2.ics" name="test/Horde/Icalendar/fixtures/timezone2.ics" />
<install as="Horde/Icalendar/fixtures/timezone3.ics" name="test/Horde/Icalendar/fixtures/timezone3.ics" />
<install as="Horde/Icalendar/fixtures/timezone4.ics" name="test/Horde/Icalendar/fixtures/timezone4.ics" />
<install as="Horde/Icalendar/fixtures/vcal20.ics" name="test/Horde/Icalendar/fixtures/vcal20.ics" />
<install as="Horde/Icalendar/fixtures/vfreebusy1.ics" name="test/Horde/Icalendar/fixtures/vfreebusy1.ics" />
<install as="Horde/Icalendar/fixtures/vfreebusy2.ics" name="test/Horde/Icalendar/fixtures/vfreebusy2.ics" />
Expand Down Expand Up @@ -1176,7 +1184,7 @@ Lots of improvements, bugfixes and support for more fields and members of the iC
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2015-06-18</date>
<date>2015-06-26</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
Expand Down
110 changes: 7 additions & 103 deletions framework/Icalendar/test/Horde/Icalendar/ExportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,8 @@ public function testTimezone()
$event->setAttribute('DTSTAMP', $date);
$event->setAttribute('DTSTART', $date);
$ical->addComponent($event);
$this->assertEquals(
'BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde iCalendar Library//EN
BEGIN:VEVENT
UID:uid
DTSTAMP:20100101T010000Z
DTSTART:20100101T010000Z
END:VEVENT
END:VCALENDAR
',
$this->assertStringEqualsFile(
__DIR__ . '/fixtures/timezone1.ics',
$ical->exportVCalendar()
);

Expand All @@ -198,56 +189,14 @@ public function testTimezone()
$date->setTimezone('Europe/Berlin');
$event->setAttribute('DTSTART', $date, array('TZID' => 'Europe/Berlin'));
$ical->addComponent($event);
$this->assertEquals(
'BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde iCalendar Library//EN
BEGIN:VEVENT
UID:uid
DTSTAMP:20100101T010000Z
DTSTART;TZID=Europe/Berlin:20100101T020000
END:VEVENT
END:VCALENDAR
',
$this->assertStringEqualsFile(
__DIR__ . '/fixtures/timezone2.ics',
$ical->exportVCalendar()
);

$ical = new Horde_Icalendar();
$tz = $ical->parsevCalendar(
'BEGIN:VCALENDAR
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19800406T010000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU;UNTIL=19800406T00000Z
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19800928T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=9;UNTIL=19950923T23000Z
TZNAME:CE-T
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19961027T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CE-T
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
'
file_get_contents(__DIR__ . '/fixtures/timezone3.ics')
);
$tz = $ical->getComponent(0);
$ical = new Horde_Icalendar();
Expand All @@ -267,53 +216,8 @@ public function testTimezone()
$start->mday++;
$event->setAttribute('DTSTART', $start, array('TZID' => 'Europe/Berlin'));
$ical->addComponent($event);
$this->assertEquals(
'BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde iCalendar Library//EN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19800406T010000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU;UNTIL=19800406T00000Z
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19800928T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=9;UNTIL=19950923T23000Z
TZNAME:CE-T
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19961027T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CE-T
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:uid
DTSTAMP:20100101T010000Z
DTSTART;TZID=Europe/Berlin:20100101T020000
END:VEVENT
BEGIN:VEVENT
UID:uid2
DTSTAMP:20100101T010000Z
DTSTART;TZID=Europe/Berlin:20100102T020000
END:VEVENT
END:VCALENDAR
',
$this->assertStringEqualsFile(
__DIR__ . '/fixtures/timezone4.ics',
$ical->exportVCalendar()
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde iCalendar Library//EN
BEGIN:VEVENT
UID:uid
DTSTAMP:20100101T010000Z
DTSTART:20100101T010000Z
END:VEVENT
END:VCALENDAR
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde iCalendar Library//EN
BEGIN:VEVENT
UID:uid
DTSTAMP:20100101T010000Z
DTSTART;TZID=Europe/Berlin:20100101T020000
END:VEVENT
END:VCALENDAR
33 changes: 33 additions & 0 deletions framework/Icalendar/test/Horde/Icalendar/fixtures/timezone3.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BEGIN:VCALENDAR
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19800406T010000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU;UNTIL=19800406T00000Z
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19800928T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=9;UNTIL=19950923T23000Z
TZNAME:CE-T
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19961027T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CE-T
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
45 changes: 45 additions & 0 deletions framework/Icalendar/test/Horde/Icalendar/fixtures/timezone4.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//The Horde Project//Horde iCalendar Library//EN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19800406T010000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU;UNTIL=19800406T00000Z
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19800928T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=9;UNTIL=19950923T23000Z
TZNAME:CE-T
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19961027T010000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CE-T
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:uid
DTSTAMP:20100101T010000Z
DTSTART;TZID=Europe/Berlin:20100101T020000
END:VEVENT
BEGIN:VEVENT
UID:uid2
DTSTAMP:20100101T010000Z
DTSTART;TZID=Europe/Berlin:20100102T020000
END:VEVENT
END:VCALENDAR

0 comments on commit 9ced8c8

Please sign in to comment.