Skip to content

Commit

Permalink
Move tests to timezonesTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Feb 11, 2014
1 parent 8e231e6 commit 76a135f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 52 deletions.
2 changes: 0 additions & 2 deletions framework/Icalendar/package.xml
Expand Up @@ -406,7 +406,6 @@
<file name="AttributeTest.php" role="test" />
<file name="bootstrap.php" role="test" />
<file name="CharsetTest.php" role="test" />
<file name="DateTest.php" role="test" />
<file name="ExportTest.php" role="test" />
<file name="FreeBusyTest.php" role="test" />
<file name="ParseTest.php" role="test" />
Expand Down Expand Up @@ -598,7 +597,6 @@
<install as="Horde/Icalendar/AttributeTest.php" name="test/Horde/Icalendar/AttributeTest.php" />
<install as="Horde/Icalendar/bootstrap.php" name="test/Horde/Icalendar/bootstrap.php" />
<install as="Horde/Icalendar/CharsetTest.php" name="test/Horde/Icalendar/CharsetTest.php" />
<install as="Horde/Icalendar/DateTest.php" name="test/Horde/Icalendar/DateTest.php" />
<install as="Horde/Icalendar/ExportTest.php" name="test/Horde/Icalendar/ExportTest.php" />
<install as="Horde/Icalendar/FreeBusyTest.php" name="test/Horde/Icalendar/FreeBusyTest.php" />
<install as="Horde/Icalendar/ParseTest.php" name="test/Horde/Icalendar/ParseTest.php" />
Expand Down
50 changes: 0 additions & 50 deletions framework/Icalendar/test/Horde/Icalendar/DateTest.php

This file was deleted.

37 changes: 37 additions & 0 deletions framework/Icalendar/test/Horde/Icalendar/TimezonesTest.php
Expand Up @@ -42,4 +42,41 @@ public function testFiles()
'Failed parsing file ' . basename($file));
}
}

public function testBug12843LocalTimezoneNotTheSame()
{
$tz = date_default_timezone_get();
date_default_timezone_set('America/New_York');
$ical = new Horde_Icalendar();
$ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/bug12843.ics'));
foreach ($ical->getComponents() as $component) {
if ($component->getType() != 'vEvent') {
continue;
}
$date_params = $component->getAttribute('DTSTART', true);
$date = $component->getAttribute('DTSTART');
$start = new Horde_Date($date, $date_params[0]['TZID']);
$this->assertEquals(18, $start->hour);
}
date_default_timezone_set($tz);
}

public function testBug12843LocalTimezoneTheSame()
{
$tz = date_default_timezone_get();
date_default_timezone_set('Europe/Berlin');
$ical = new Horde_Icalendar();
$ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/bug12843.ics'));
foreach ($ical->getComponents() as $component) {
if ($component->getType() != 'vEvent') {
continue;
}
$date_params = $component->getAttribute('DTSTART', true);
$date = $component->getAttribute('DTSTART');
$start = new Horde_Date($date, $date_params[0]['TZID']);
$this->assertEquals(18, $start->hour);
}
date_default_timezone_set($tz);
}

}

0 comments on commit 76a135f

Please sign in to comment.