diff --git a/tests/Doctrine/Tests/DBAL/Types/DateTest.php b/tests/Doctrine/Tests/DBAL/Types/DateTest.php index 9f9903a0f..3368a6c93 100644 --- a/tests/Doctrine/Tests/DBAL/Types/DateTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/DateTest.php @@ -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