[BUGFIX] use gmmktime in checkConditionMatcherForDateFunction unit test 65/58165/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Mon, 3 Sep 2018 20:58:40 +0000 (22:58 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 3 Sep 2018 21:20:49 +0000 (23:20 +0200)
The arguments are now treated as parts of a UTC date/time and
prevents different results depending on the system date.timezone
settings.

Releases: master
Resolves: #86128
Change-Id: Ieb336ea43eb246ec0e0c5a7db8194c03a0801f83
Reviewed-on: https://review.typo3.org/58165
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Tests/Unit/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcherTest.php

index 964f005..11acd1b 100644 (file)
@@ -138,7 +138,7 @@ class AbstractConditionMatcherTest extends UnitTestCase
      */
     public function checkConditionMatcherForDateFunction(string $format, int $expressionValue, bool $expected): void
     {
-        $GLOBALS['SIM_EXEC_TIME'] = mktime(11, 4, 0, 1, 17, 1945);
+        $GLOBALS['SIM_EXEC_TIME'] = gmmktime(11, 4, 0, 1, 17, 1945);
         GeneralUtility::makeInstance(Context::class)
             ->setAspect('date', new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['SIM_EXEC_TIME'])));
         $this->assertSame(