protected function simulateFrontendEnvironment()
{
$this->tsfeBackup = true === isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : null;
$this->workingDirectoryBackup = getcwd();
chdir(constant('PATH_site'));
$typoScriptSetup = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$GLOBALS['TSFE'] = new \stdClass();
$template = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\TemplateService');
$template->tt_track = 0;
$template->init();
$template->getFileName_backPath = constant('PATH_site');
$GLOBALS['TSFE']->tmpl = $template;
$GLOBALS['TSFE']->tmpl->setup = $typoScriptSetup;
$GLOBALS['TSFE']->config = $typoScriptSetup;
}