[TASK] Improve Test
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 9 Feb 2013 12:40:53 +0000 (13:40 +0100)
committerMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 9 Feb 2013 16:06:00 +0000 (17:06 +0100)
Refine the test for DateTimeConverter timezone handling.

The suggested backport from Flow Fluid was already in place, but the
improved test was missing.

Resolves: #44213
Releases: 6.1
Change-Id: I3c7d73c1bba8ebecc5d49020d155d5d27c256961
Reviewed-on: https://review.typo3.org/18155
Reviewed-by: Markus Günther
Tested-by: Markus Günther
Reviewed-by: Daniel Hürtgen
Reviewed-by: Wouter Wolters
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/DateTimeConverterTest.php

index ac88b77..fdf836e 100644 (file)
@@ -286,11 +286,15 @@ class DateTimeConverterTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function convertFromAllowsToOverrideTheTimezone() {
                $source = array(
-                       'date' => '2011-06-16',
-                       'dateFormat' => 'Y-m-d',
+                       'date' => '2011-06-16 12:30:59',
+                       'dateFormat' => 'Y-m-d H:i:s',
                        'timezone' => 'Atlantic/Reykjavik'
                );
                $date = $this->converter->convertFrom($source, 'DateTime');
+               $this->assertSame('2011-06-16', $date->format('Y-m-d'));
+               $this->assertSame('12', $date->format('H'));
+               $this->assertSame('30', $date->format('i'));
+               $this->assertSame('59', $date->format('s'));
                $this->assertSame('Atlantic/Reykjavik', $date->getTimezone()->getName());
        }