From 8e3c7967f1da00f748ed3a0edede8460e4c74a74 Mon Sep 17 00:00:00 2001 From: Anja Leichsenring Date: Wed, 12 Jun 2019 09:36:21 +0200 Subject: [PATCH] Revert "[BUGFIX] Add compatibility to TYPO3 Core v9" This reverts commit 0b4e0addc5c3bc501a9e9ffa98120d9599ba705c. --- Classes/Core/Testbase.php | 24 +-------------------- Resources/Core/Build/UnitTestsBootstrap.php | 7 ++---- composer.json | 14 ++++++------ 3 files changed, 10 insertions(+), 35 deletions(-) diff --git a/Classes/Core/Testbase.php b/Classes/Core/Testbase.php index c795a958..f00ec8d5 100644 --- a/Classes/Core/Testbase.php +++ b/Classes/Core/Testbase.php @@ -43,12 +43,6 @@ */ class Testbase { - /** - * Usually contains the major version of TYPO3 Core - * @var int - */ - private $coreVersion; - /** * This class must be called in CLI environment as a security measure * against path disclosures and other stuff. Check this within @@ -60,11 +54,6 @@ public function __construct() if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { die('This script supports command line usage only. Please check your command.'); } - if (class_exists(\TYPO3\CMS\Frontend\Page\PageGenerator::class)) { - $this->coreVersion = 9; - } else { - $this->coreVersion = 10; - } } /** @@ -101,13 +90,7 @@ public function defineBaseConstants() */ public function defineSitePath() { - if ($this->coreVersion === 9) { - define('PATH_site', $this->getWebRoot()); - define('PATH_thisScript', PATH_site . 'typo3/index.php'); - $_SERVER['SCRIPT_NAME'] = PATH_thisScript; - } else { - $_SERVER['SCRIPT_NAME'] = $this->getWebRoot() . 'typo3/index.php'; - } + $_SERVER['SCRIPT_NAME'] = $this->getWebRoot() . 'typo3/index.php'; if (!file_exists($_SERVER['SCRIPT_NAME'])) { $this->exitWithMessage('Unable to determine path to entry script. Please check your path or set an environment variable \'TYPO3_PATH_ROOT\' to your root path.'); } @@ -918,11 +901,6 @@ protected function resolvePath(string $path) return $path; } - public function getCurrentTypo3Version(): int - { - return $this->coreVersion; - } - /** * Writes $content to the file $file. This is a simplified version * of GeneralUtility::writeFile that does not fix permissions. diff --git a/Resources/Core/Build/UnitTestsBootstrap.php b/Resources/Core/Build/UnitTestsBootstrap.php index e0b28210..b3e935f5 100644 --- a/Resources/Core/Build/UnitTestsBootstrap.php +++ b/Resources/Core/Build/UnitTestsBootstrap.php @@ -29,6 +29,7 @@ call_user_func(function () { $testbase = new \TYPO3\TestingFramework\Core\Testbase(); $testbase->enableDisplayErrors(); + $testbase->defineBaseConstants(); // These if's are for core testing (package typo3/cms) only. cms-composer-installer does // not create the autoload-include.php file that sets these env vars and sets composer @@ -56,10 +57,6 @@ $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/tests'); $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/transient'); - if ($testbase->getCurrentTypo3Version() === 9) { - $testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/uploads'); - } - // Retrieve an instance of class loader and inject to core bootstrap $classLoader = require $testbase->getPackagesPath() . '/autoload.php'; \TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader); @@ -73,7 +70,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*'; $cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend( - ($testbase->getCurrentTypo3Version() === 9 ? 'cache_core' : 'core'), + 'core', new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production', []) ); // Set all packages to active diff --git a/composer.json b/composer.json index 4e0859bb..9fc3c4ef 100644 --- a/composer.json +++ b/composer.json @@ -28,16 +28,16 @@ "phpunit/phpunit": "^7.5.6 || ^8", "mikey179/vfsstream": "~1.6.0", "typo3fluid/fluid": "^2.5", - "typo3/cms-core": "^9.5 || 10.*.*@dev", - "typo3/cms-backend": "^9.5 || 10.*.*@dev", - "typo3/cms-frontend": "^9.5 || 10.*.*@dev", - "typo3/cms-extbase": "^9.5 || 10.*.*@dev", - "typo3/cms-fluid": "^9.5 || 10.*.*@dev", - "typo3/cms-recordlist": "^9.5 || 10.*.*@dev" + "typo3/cms-core": "10.*.*@dev", + "typo3/cms-backend": "10.*.*@dev", + "typo3/cms-frontend": "10.*.*@dev", + "typo3/cms-extbase": "10.*.*@dev", + "typo3/cms-fluid": "10.*.*@dev", + "typo3/cms-recordlist": "10.*.*@dev" }, "suggest": { "codeception/codeception": "^3", - "typo3/cms-styleguide": "^9.0 || 10.*.*@dev" + "typo3/cms-styleguide": "^9.0" }, "config": { "vendor-dir": ".Build/vendor",