Skip to content

Commit

Permalink
Merge pull request #122 from sitegeist/121-typo3-13-support
Browse files Browse the repository at this point in the history
TYPO3 13.2 support
  • Loading branch information
ulrichmathes authored Aug 23, 2024
2 parents fd089d3 + 595983f commit 339970b
Show file tree
Hide file tree
Showing 25 changed files with 186 additions and 496 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>
70 changes: 34 additions & 36 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,16 +101,16 @@ 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
if ! type "docker-compose" > /dev/null; then
echo "This script relies on docker and docker-compose. Please install" >&2
# Test if docker compose exists, else exit out with error
if ! type "docker" > /dev/null; then
echo "This script relies on docker and docker compose. Please install" >&2
exit 1
fi

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 Expand Up @@ -216,41 +214,41 @@ fi
case ${TEST_SUITE} in
composerInstall)
setUpDockerComposeDotEnv
docker-compose run composer_install
docker compose run composer_install
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerInstallMax)
setUpDockerComposeDotEnv
docker-compose run composer_install_max
docker compose run composer_install_max
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerInstallMin)
setUpDockerComposeDotEnv
docker-compose run composer_install_min
docker compose run composer_install_min
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerValidate)
setUpDockerComposeDotEnv
docker-compose run composer_validate
docker compose run composer_validate
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
functional)
setUpDockerComposeDotEnv
case ${DBMS} in
mariadb)
docker-compose run functional_mariadb10
docker compose run functional_mariadb10
SUITE_EXIT_CODE=$?
;;
mssql)
docker-compose run functional_mssql2019latest
docker compose run functional_mssql2019latest
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run functional_postgres10
docker compose run functional_postgres10
SUITE_EXIT_CODE=$?
;;
sqlite)
Expand All @@ -259,7 +257,7 @@ case ${TEST_SUITE} in
# root if docker creates it. Thank you, docker. We create the path beforehand
# to avoid permission issues.
mkdir -p ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
docker-compose run functional_sqlite
docker compose run functional_sqlite
SUITE_EXIT_CODE=$?
;;
*)
Expand All @@ -268,25 +266,25 @@ case ${TEST_SUITE} in
echo "${HELP}" >&2
exit 1
esac
docker-compose down
docker compose down
;;
lintPhp)
setUpDockerComposeDotEnv
docker-compose run lint_php
docker compose run lint_php
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
lintEditorconfig)
setUpDockerComposeDotEnv
docker-compose run lint_editorconfig
docker compose run lint_editorconfig
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
unit)
setUpDockerComposeDotEnv
docker-compose run unit
docker compose run unit
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
update)
# pull typo3/core-testing-*:latest versions of those ones that exist locally
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>
3 changes: 1 addition & 2 deletions Build/testing-docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2.3'
services:
mariadb10:
image: mariadb:10
Expand Down Expand Up @@ -38,7 +37,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
Loading

0 comments on commit 339970b

Please sign in to comment.