|
16 | 16 | use TYPO3\CMS\Core\Information\Typo3Version; |
17 | 17 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
18 | 18 | use TYPO3\TestingFramework\Core\Acceptance\Extension\BackendEnvironment; |
| 19 | +use TYPO3\TestingFramework\Core\Testbase; |
19 | 20 |
|
20 | 21 | class BackendContainerEnvironment extends BackendEnvironment |
21 | 22 | { |
@@ -86,14 +87,38 @@ public function bootstrapTypo3Environment(SuiteEvent $suiteEvent): void |
86 | 87 | if ($typo3Version->getMajorVersion() < 13) { |
87 | 88 | return; |
88 | 89 | } |
89 | | - $content = "<?php |
90 | | -
|
91 | | -call_user_func(static function () { |
92 | | - \$classLoader = require __DIR__ . '/../../../../../..' . '/vendor/autoload.php'; |
93 | | - \TYPO3\TestingFramework\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE); |
94 | | - \TYPO3\CMS\Core\Core\Bootstrap::init(\$classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run(); |
95 | | -});"; |
96 | | - $instancePath = ORIGINAL_ROOT . 'typo3temp/var/tests/acceptance'; |
97 | | - file_put_contents($instancePath . '/typo3/index.php', $content); |
| 90 | + $testbase = new Testbase(); |
| 91 | + $copyFiles = [ |
| 92 | + // Create favicon.ico to suppress potential javascript errors in console |
| 93 | + // which are caused by calling a non html in the browser, e.g. seo sitemap xml |
| 94 | + 'typo3/sysext/backend/Resources/Public/Icons/favicon.ico' => [ |
| 95 | + 'favicon.ico', |
| 96 | + ], |
| 97 | + // Provide some files into the test instance normally added by installer |
| 98 | + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess' => [ |
| 99 | + '.htaccess', |
| 100 | + ], |
| 101 | + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/resources-root-htaccess' => [ |
| 102 | + 'fileadmin/.htaccess', |
| 103 | + ], |
| 104 | + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess' => [ |
| 105 | + 'fileadmin/_temp_/.htaccess', |
| 106 | + ], |
| 107 | + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html' => [ |
| 108 | + 'fileadmin/_temp_/index.html', |
| 109 | + ], |
| 110 | + 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess' => [ |
| 111 | + 'typo3temp/var/.htaccess', |
| 112 | + ], |
| 113 | + ]; |
| 114 | + foreach ($copyFiles as $sourceFile => $targetFiles) { |
| 115 | + foreach ($targetFiles as $targetFile) { |
| 116 | + $testbase->createDirectory(dirname(ltrim($targetFile, '/'))); |
| 117 | + copy( |
| 118 | + from: ltrim($sourceFile, '/'), |
| 119 | + to: ltrim($targetFile, '/'), |
| 120 | + ); |
| 121 | + } |
| 122 | + } |
98 | 123 | } |
99 | 124 | } |
0 commit comments