[BUGFIX] Use correct timezone in DataMapperTest 45/47945/3
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Wed, 27 Apr 2016 21:07:07 +0000 (23:07 +0200)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 28 Apr 2016 15:31:25 +0000 (17:31 +0200)
The date/time generated by the datamapper is in UTC, so the test
must check for a date/time in that timezone too independent of the
configured timezone of the system.

Resolves: #75954
Releases: master, 7.6
Change-Id: I64f014b0d60b805bcbffd08dc50b924b925d022a
Reviewed-on: https://review.typo3.org/47945
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php

index e27b08a..dce21e7 100644 (file)
@@ -275,7 +275,7 @@ class DataMapperTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $columnMap = new ColumnMap('column_name', 'propertyName');
         $columnMap->setDateTimeStorageFormat('datetime');
         $datetimeAsString = '2013-04-15 09:30:00';
-        $input = new \DateTime($datetimeAsString);
+        $input = new \DateTime($datetimeAsString, new \DateTimeZone('UTC'));
         $this->assertEquals('2013-04-15 09:30:00', $subject->getPlainValue($input, $columnMap));
         $columnMap->setDateTimeStorageFormat('date');
         $this->assertEquals('2013-04-15', $subject->getPlainValue($input, $columnMap));