Skip to content

Commit 05b4d8e

Browse files
committed
[TASK] Add TYPO3 v14 support
1 parent d0c316d commit 05b4d8e

104 files changed

Lines changed: 6346 additions & 1119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Build/UnitTests.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

Build/UnitTestsBootstrap.php

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
<?php
22

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\Cache\PackageCacheInterface;
10+
use TYPO3\CMS\Core\Package\PackageManager;
11+
use TYPO3\CMS\Core\Package\UnitTestPackageManager;
12+
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
13+
use TYPO3\CMS\Core\Utility\GeneralUtility;
14+
use TYPO3\TestingFramework\Core\Testbase;
15+
316
/*
417
* This file is part of the TYPO3 CMS project.
518
*
@@ -12,7 +25,6 @@
1225
*
1326
* The TYPO3 project - inspiring people to share!
1427
*/
15-
1628
/**
1729
* Boilerplate for a unit test phpunit boostrap file.
1830
*
@@ -28,7 +40,7 @@
2840
* adapt to extensions needs.
2941
*/
3042
(static function () {
31-
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
43+
$testbase = new Testbase();
3244

3345
// These if's are for core testing (package typo3/cms) only. cms-composer-installer does
3446
// not create the autoload-include.php file that sets these env vars and sets composer
@@ -46,40 +58,40 @@
4658

4759
$testbase->defineSitePath();
4860

49-
$requestType = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI;
61+
$requestType = SystemEnvironmentBuilder::REQUESTTYPE_BE | SystemEnvironmentBuilder::REQUESTTYPE_CLI;
5062
\TYPO3\TestingFramework\Core\SystemEnvironmentBuilder::run(0, $requestType);
5163

52-
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3conf/ext');
53-
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/assets');
54-
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/tests');
55-
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/transient');
64+
$testbase->createDirectory(Environment::getPublicPath() . '/typo3conf/ext');
65+
$testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/assets');
66+
$testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/var/tests');
67+
$testbase->createDirectory(Environment::getPublicPath() . '/typo3temp/var/transient');
5668

5769
// Retrieve an instance of class loader and inject to core bootstrap
5870
$classLoader = require $testbase->getPackagesPath() . '/autoload.php';
59-
\TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader);
71+
Bootstrap::initializeClassLoader($classLoader);
6072

6173
// Initialize default TYPO3_CONF_VARS
62-
$configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager();
74+
$configurationManager = new ConfigurationManager();
6375
$GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration();
6476

65-
$cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend(
77+
$cache = new PhpFrontend(
6678
'core',
67-
new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production', [])
79+
new NullBackend('production', [])
6880
);
6981

7082
// Set all packages to active
71-
if (interface_exists(\TYPO3\CMS\Core\Package\Cache\PackageCacheInterface::class)) {
72-
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(\TYPO3\CMS\Core\Package\UnitTestPackageManager::class, \TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache));
83+
if (interface_exists(PackageCacheInterface::class)) {
84+
$packageManager = Bootstrap::createPackageManager(UnitTestPackageManager::class, Bootstrap::createPackageCache($cache));
7385
} else {
7486
// v10 compatibility layer
7587
// @deprecated Will be removed when v10 compat is dropped from testing-framework
76-
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(\TYPO3\CMS\Core\Package\UnitTestPackageManager::class, $cache);
88+
$packageManager = Bootstrap::createPackageManager(UnitTestPackageManager::class, $cache);
7789
}
7890

79-
\TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
80-
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager($packageManager);
91+
GeneralUtility::setSingletonInstance(PackageManager::class, $packageManager);
92+
ExtensionManagementUtility::setPackageManager($packageManager);
8193

8294
$testbase->dumpClassLoadingInformation();
8395

84-
\TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
96+
GeneralUtility::purgeInstances();
8597
})();

0 commit comments

Comments
 (0)