Commit 8ebd4449 authored by beberlei's avatar beberlei

DDC-179 - One more test for possible summer-time crazyness

parent 83b247b8
......@@ -11,12 +11,19 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
{
protected
$_platform,
$_type;
$_type,
$_tz;
protected function setUp()
{
$this->_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform();
$this->_type = Type::getType('date');
$this->_tz = date_default_timezone_get();
}
public function tearDown()
{
date_default_timezone_set($this->_tz);
}
public function testDateConvertsToDatabaseValue()
......@@ -41,4 +48,17 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
$this->assertEquals('00:00:00', $date->format('H:i:s'));
}
public function testDateRests_SummerTimeAffection()
{
date_default_timezone_set('Europe/Berlin');
$date = $this->_type->convertToPHPValue('2009-08-01', $this->_platform);
$this->assertEquals('00:00:00', $date->format('H:i:s'));
$this->assertEquals('2009-08-01', $date->format('Y-m-d'));
$date = $this->_type->convertToPHPValue('2009-11-01', $this->_platform);
$this->assertEquals('00:00:00', $date->format('H:i:s'));
$this->assertEquals('2009-11-01', $date->format('Y-m-d'));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment