-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* drop TYPO3 10 Support * add TYPO3 13 Support * use CI
- Loading branch information
1 parent
1161b69
commit 01e5857
Showing
21 changed files
with
244 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
testsuite: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
TYPO3: [ '11' , '12', '13'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP Version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
tools: composer:v2 | ||
|
||
- name: Start MySQL | ||
run: sudo /etc/init.d/mysql start | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.composer/cache | ||
key: dependencies-composer-${{ hashFiles('composer.json') }} | ||
|
||
- name: Install composer dependencies TYPO3 13 | ||
if: matrix.TYPO3 == '13' | ||
run: | | ||
composer install --no-progress --no-interaction | ||
- name: Install composer dependencies TYPO3 12 | ||
if: matrix.TYPO3 == '12' | ||
run: | | ||
composer require typo3/cms-core:^12.4 --no-progress --no-interaction --dev -W | ||
- name: Install composer dependencies TYPO3 11 | ||
if: matrix.TYPO3 == '11' | ||
run: | | ||
composer require typo3/cms-core:^11.5 --no-progress --no-interaction --dev -W | ||
- name: Phpstan 12/13 | ||
if: matrix.TYPO3 != '11' | ||
run: .Build/bin/phpstan analyze -c Build/phpstan.neon | ||
- name: Phpstan 11 | ||
if: matrix.TYPO3 == '11' | ||
run: .Build/bin/phpstan analyze -c Build/phpstan11.neon | ||
- name: Phpcsfix | ||
run: .Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no | ||
- name: Unit Tests | ||
run: .Build/bin/phpunit -c Build/phpunit/UnitTests.xml Tests/Unit | ||
- name: Functional Tests | ||
run: | | ||
export typo3DatabaseName="typo3"; | ||
export typo3DatabaseHost="127.0.0.1"; | ||
export typo3DatabaseUsername="root"; | ||
export typo3DatabasePassword="root"; | ||
.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml Tests/Functional |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/build/ | ||
/composer.lock | ||
/.php_cs.cache | ||
/public/ | ||
/Build/phpunit/.phpunit.* | ||
/public/ | ||
/.Build/ |
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,5 @@ | ||
<?php | ||
|
||
$config = \TYPO3\CodingStandards\CsFixerConfig::create(); | ||
$config->getFinder()->exclude(['var'])->in(__DIR__ . '/..'); | ||
return $config; |
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,6 @@ | ||
includes: | ||
- ../.Build/vendor/saschaegerer/phpstan-typo3/extension.neon | ||
parameters: | ||
level: 5 | ||
paths: | ||
- %currentWorkingDirectory%/Classes |
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,8 @@ | ||
includes: | ||
- ../.Build/vendor/saschaegerer/phpstan-typo3/extension.neon | ||
parameters: | ||
level: 5 | ||
paths: | ||
- %currentWorkingDirectory%/Classes | ||
excludePaths: | ||
- %currentWorkingDirectory%/Classes/Listener/AfterCacheableContentIsGenerated.php |
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,12 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/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> | ||
<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,12 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/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> | ||
<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,74 @@ | ||
<?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! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Information\Typo3Version; | ||
|
||
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 (version_compare((new Typo3Version())->getVersion(), '11.3.0', '>')) { | ||
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager( | ||
\TYPO3\CMS\Core\Package\UnitTestPackageManager::class, | ||
\TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache) | ||
); | ||
} else { | ||
$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
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Assetcollector\Hooks; | ||
|
||
/* | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Assetcollector\Resource; | ||
|
||
/* | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Assetcollector\ViewHelpers; | ||
|
||
/* | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Assetcollector\ViewHelpers; | ||
|
||
/* | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Assetcollector\ViewHelpers; | ||
|
||
/* | ||
|
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 was deleted.
Oops, something went wrong.
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.