Skip to content

Commit

Permalink
[v13] update testing to PHPUnit 11
Browse files Browse the repository at this point in the history
even there are no unit and functional test yet available
  • Loading branch information
ulrichmathes committed Jul 16, 2024
1 parent d329be2 commit 5948427
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 48 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,8 @@ jobs:
strategy:
max-parallel: 2
matrix:
php-versions: ['8.2', '8.1', '8.0']
typo3-versions: [12, 11]
exclude:
- php-versions: '8.0'
typo3-versions: 12
include:
- php-versions: '7.4'
typo3-versions: 11
php-versions: ['8.3', '8.2']
typo3-versions: [13, 12]

name: Unit (PHP ${{ matrix.php-versions }}, TYPO3 ${{ matrix.typo3-versions }})
steps:
Expand Down Expand Up @@ -80,14 +74,8 @@ jobs:
strategy:
max-parallel: 2
matrix:
php-versions: ['8.2', '8.1', '8.0']
typo3-versions: [12, 11]
exclude:
- php-versions: '8.0'
typo3-versions: 12
include:
- php-versions: '7.4'
typo3-versions: 11
php-versions: ['8.3', '8.2']
typo3-versions: [13, 12]

name: Functional (PHP ${{ matrix.php-versions }}, TYPO3 ${{ matrix.typo3-versions }})
steps:
Expand Down
15 changes: 7 additions & 8 deletions Build/FunctionalTests.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
backupGlobals="true"
bootstrap="FunctionalTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="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" />
<const name="TYPO3_MODE" value="BE"/>
<ini name="display_errors" value="1"/>
<env name="TYPO3_CONTEXT" value="Testing"/>
</php>
</phpunit>
26 changes: 12 additions & 14 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Also used by github actions for test execution.
Usage: $0 [options] [file]
No arguments: Run all unit tests with PHP 7.4
No arguments: Run all unit tests with PHP 8.2
Options:
-s <...>
Expand All @@ -61,17 +61,15 @@ Options:
- postgres: use postgres
- sqlite: use sqlite
-p <7.4|8.0|8.1|8.2>
-p <8.2|8.3>
Specifies the PHP minor version to be used
- 7.4 (default): use PHP 7.4
- 8.0: use PHP 8.0
- 8.1: use PHP 8.1
- 8.2: use PHP 8.2
- 8.2 (default): use PHP 8.2
- 8.3: use PHP 8.3
-t <11|12>
-t <12|13>
Specifies the TYPO3 version to be used
- 11 (default): use TYPO3 11
- 12: use TYPO3 12
- 12 (default): use TYPO3 12
- 13: use TYPO3 13
-e "<phpunit options>"
Only with -s functional|unit
Expand Down Expand Up @@ -103,11 +101,11 @@ Options:
Show this help.
Examples:
# Run unit tests using PHP 7.4
# Run unit tests using PHP 8.2 TYPO3 12
./Build/Scripts/runTests.sh
# Run unit tests using PHP 7.3
./Build/Scripts/runTests.sh -p 7.3
# Run unit tests using PHP 8.3 TYPO3 13
./Build/Scripts/runTests.sh -p 8.3 -t 13
EOF

# Test if docker-compose exists, else exit out with error
Expand All @@ -133,8 +131,8 @@ else
fi
TEST_SUITE="unit"
DBMS="mariadb"
PHP_VERSION="7.4"
TYPO3_VERSION="11"
PHP_VERSION="8.2"
TYPO3_VERSION="12"
PHP_XDEBUG_ON=0
PHP_XDEBUG_PORT=9003
EXTRA_TEST_OPTIONS=""
Expand Down
16 changes: 7 additions & 9 deletions Build/UnitTests.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
backupGlobals="true"
bootstrap="UnitTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="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" />
<const name="TYPO3_MODE" value="BE"/>
<ini name="display_errors" value="1"/>
<env name="TYPO3_CONTEXT" value="Testing"/>
</php>
</phpunit>
2 changes: 1 addition & 1 deletion Build/testing-docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
fi
composer config allow-plugins.typo3/class-alias-loader true
composer config allow-plugins.typo3/cms-composer-installers true
composer require typo3/minimal "^${TYPO3_VERSION}" --prefer-dist --no-progress --no-suggest
composer require typo3/minimal "^${TYPO3_VERSION}" --prefer-dist --no-progress
composer install --no-progress --no-interaction;
"
composer_install_max:
Expand Down

0 comments on commit 5948427

Please sign in to comment.