|
1 | 1 | <?php |
| 2 | + |
| 3 | +use TYPO3\CMS\Core\Cache\Backend\NullBackend; |
| 4 | +use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; |
| 5 | +use TYPO3\CMS\Core\Configuration\ConfigurationManager; |
| 6 | +use TYPO3\CMS\Core\Core\Bootstrap; |
| 7 | +use TYPO3\CMS\Core\Core\Environment; |
| 8 | +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; |
| 9 | +use TYPO3\CMS\Core\Package\UnitTestPackageManager; |
| 10 | +use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; |
| 11 | +use TYPO3\CMS\Core\Utility\GeneralUtility; |
| 12 | +use TYPO3\TestingFramework\Core\Testbase; |
| 13 | + |
2 | 14 | /* |
3 | 15 | * This file is part of the TYPO3 CMS project. |
4 | 16 | * |
|
13 | 25 | */ |
14 | 26 |
|
15 | 27 | call_user_func(function () { |
16 | | - $testbase = new \TYPO3\TestingFramework\Core\Testbase(); |
| 28 | + $testbase = new Testbase(); |
17 | 29 |
|
18 | 30 | // These if's are for core testing (package typo3/cms) only. cms-composer-installer does |
19 | 31 | // not create the autoload-include.php file that sets these env vars and sets composer |
|
32 | 44 | $testbase->defineSitePath(); |
33 | 45 |
|
34 | 46 | $composerMode = defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE === true; |
35 | | - $requestType = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI; |
36 | | - \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, $requestType, $composerMode); |
| 47 | + $requestType = SystemEnvironmentBuilder::REQUESTTYPE_BE | SystemEnvironmentBuilder::REQUESTTYPE_CLI; |
| 48 | + SystemEnvironmentBuilder::run(0, $requestType, $composerMode); |
37 | 49 |
|
38 | | - $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3conf/ext'); |
39 | | - $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/assets'); |
40 | | - $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/tests'); |
41 | | - $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/transient'); |
| 50 | + $testbase->createDirectory(Environment::getPublicPath() . '/typo3conf/ext'); |
| 51 | + $testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/assets'); |
| 52 | + $testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/var/tests'); |
| 53 | + $testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/var/transient'); |
42 | 54 |
|
43 | 55 | // Retrieve an instance of class loader and inject to core bootstrap |
44 | 56 | $classLoader = require $testbase->getPackagesPath() . '/autoload.php'; |
45 | | - \TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader); |
| 57 | + Bootstrap::initializeClassLoader($classLoader); |
46 | 58 |
|
47 | 59 | // Initialize default TYPO3_CONF_VARS |
48 | | - $configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager(); |
| 60 | + $configurationManager = new ConfigurationManager(); |
49 | 61 | $GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration(); |
50 | 62 |
|
51 | | - $cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend( |
| 63 | + $cache = new PhpFrontend( |
52 | 64 | 'core', |
53 | | - new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production', []), |
| 65 | + new NullBackend('production', []), |
54 | 66 | ); |
55 | 67 | // Set all packages to active |
56 | | - $packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager( |
57 | | - \TYPO3\CMS\Core\Package\UnitTestPackageManager::class, |
58 | | - \TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache) |
| 68 | + $packageManager = Bootstrap::createPackageManager( |
| 69 | + UnitTestPackageManager::class, |
| 70 | + Bootstrap::createPackageCache($cache) |
59 | 71 | ); |
60 | 72 |
|
61 | | - \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager); |
62 | | - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager($packageManager); |
| 73 | + GeneralUtility::setSingletonInstance(TYPO3\CMS\Core\Package\PackageManager::class, $packageManager); |
| 74 | + ExtensionManagementUtility::setPackageManager($packageManager); |
63 | 75 |
|
64 | 76 | $testbase->dumpClassLoadingInformation(); |
65 | 77 |
|
66 | | - \TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances(); |
| 78 | + GeneralUtility::purgeInstances(); |
67 | 79 | }); |
0 commit comments