-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from sitegeist/typo3v12
Typo3v12
- Loading branch information
Showing
29 changed files
with
1,386 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" | ||
backupGlobals="true" | ||
bootstrap="FunctionalTestsBootstrap.php" | ||
colors="true" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
failOnWarning="true" | ||
cacheDirectory=".phpunit.cache" | ||
requireCoverageMetadata="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Functional tests"> | ||
<directory>../../Tests/Functional/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<const name="TYPO3_MODE" value="BE"/> | ||
<ini name="display_errors" value="1"/> | ||
<env name="TYPO3_CONTEXT" value="Testing"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
call_user_func(function () { | ||
$testbase = new \TYPO3\TestingFramework\Core\Testbase(); | ||
$testbase->defineOriginalRootPath(); | ||
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests'); | ||
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" | ||
backupGlobals="true" | ||
bootstrap="UnitTestsBootstrap.php" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
failOnWarning="true" | ||
cacheDirectory=".phpunit.cache" | ||
requireCoverageMetadata="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Unit tests"> | ||
<directory>../../Tests/Unit/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<const name="TYPO3_MODE" value="BE"/> | ||
<ini name="display_errors" value="1"/> | ||
<env name="TYPO3_CONTEXT" value="Testing"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
call_user_func(function () { | ||
$testbase = new \TYPO3\TestingFramework\Core\Testbase(); | ||
|
||
// 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 | ||
// mode to true. testing-framework can not be used without composer anyway, so it is safe | ||
// to do this here. This way it does not matter if 'bin/phpunit' or 'vendor/phpunit/phpunit/phpunit' | ||
// is called to run the tests since the 'relative to entry script' path calculation within | ||
// SystemEnvironmentBuilder is not used. However, the binary must be called from the document | ||
// root since getWebRoot() uses 'getcwd()'. | ||
if (!getenv('TYPO3_PATH_ROOT')) { | ||
putenv('TYPO3_PATH_ROOT=' . rtrim($testbase->getWebRoot(), '/')); | ||
} | ||
if (!getenv('TYPO3_PATH_WEB')) { | ||
putenv('TYPO3_PATH_WEB=' . rtrim($testbase->getWebRoot(), '/')); | ||
} | ||
|
||
$testbase->defineSitePath(); | ||
|
||
$requestType = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI; | ||
\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, $requestType); | ||
|
||
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3conf/ext'); | ||
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/assets'); | ||
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/tests'); | ||
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/transient'); | ||
|
||
// Retrieve an instance of class loader and inject to core bootstrap | ||
$classLoader = require $testbase->getPackagesPath() . '/autoload.php'; | ||
\TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader); | ||
|
||
// Initialize default TYPO3_CONF_VARS | ||
$configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager(); | ||
$GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration(); | ||
|
||
$cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend( | ||
'core', | ||
new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production', []) | ||
); | ||
|
||
// Set all packages to active | ||
if (interface_exists(\TYPO3\CMS\Core\Package\Cache\PackageCacheInterface::class)) { | ||
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager( | ||
\TYPO3\CMS\Core\Package\UnitTestPackageManager::class, | ||
\TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache) | ||
); | ||
} else { | ||
// v10 compatibility layer | ||
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager( | ||
\TYPO3\CMS\Core\Package\UnitTestPackageManager::class, | ||
$cache | ||
); | ||
} | ||
|
||
\TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager); | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager($packageManager); | ||
|
||
$testbase->dumpClassLoadingInformation(); | ||
|
||
\TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.