21use TYPO3\CMS\Core\Core\Bootstrap;
22use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
23use TYPO3\CMS\Core\Utility\GeneralUtility;
24use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
25use TYPO3\CMS\Extbase\Object\ObjectManager;
26use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
51 protected function setUp(): void
54 $extAbsPath = ExtensionManagementUtility::extPath(
'timezones');
56 $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
57 $configurationManager = $this->createPartialMock(ConfigurationManager::class, [
'getConfiguration']);
58 $configurationManager->method(
'getConfiguration')->willReturn([]);
60 $this->importDataSet($extAbsPath .
'/Tests/Functional/Fixtures/Database/pages.xml');
61 $this->setUpFrontendRootPage(
64 'EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript',
65 $extAbsPath .
'/Configuration/TypoScript/setup.typoscript',
66 $extAbsPath .
'/Tests/Functional/Fixtures/Frontend/Basic.typoscript',
69 Bootstrap::initializeLanguageObject();
71 $loggingService = $this->getMockBuilder(LoggingService::class)->getMock();
73 $this->subject->initializeObject();
74 $this->subject->setCurrentTimezone(
'Europe/Berlin');
83 self::assertArrayHasKey(
'Europe/Berlin', $this->subject->getTimezoneArray());
92 self::assertArrayHasKey(
'UTC', $this->subject->getTimezoneArray());
93 $oldTz = $this->subject->getCurrentTimezone();
94 $this->subject->setCurrentTimezone(
'UTC');
95 self::assertSame(
'UTC', $this->subject->getCurrentTimezone()->getName());
96 $this->subject->setCurrentTimezone($oldTz->getName());
105 $this->subject->setCurrentTimezone(
'Europe/Berlin');
106 self::assertFalse($this->subject->isDst(
'2020-01-01'));
107 self::assertTrue($this->subject->isDst(
'2020-07-01'));
117 if (version_compare(TYPO3_version,
'10.0',
'>'))
119 self::assertMatchesRegularExpression(
'/GMT\+0[1|2]:?00/', $this->subject->getIcuTimezoneString());
121 self::assertRegExp(
'/GMT\+0[1|2]:?00/', $this->subject->getIcuTimezoneString());
131 if (version_compare(TYPO3_version,
'10.0',
'>'))
133 self::assertMatchesRegularExpression(
'/[3600|7200]/', $this->subject->getOffsetInSeconds());
135 self::assertRegExp(
'/[3600|7200]/', $this->subject->getOffsetInSeconds());
timezoneArrayContainsBerlin()