Skip to content

Commit

Permalink
Merge pull request #159 from sitegeist/158-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 6d6b39c + 96439ad commit a26f27a
Show file tree
Hide file tree
Showing 67 changed files with 512 additions and 1,114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
terUpload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: tomasnorre/typo3-upload-ter@v2
with:
api-token: ${{ secrets.TYPO3_API_TOKEN }}
62 changes: 40 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4

-
name: Set up Docker Compose
run: |
docker-compose --version || {
echo "Docker Compose not found, installing..."
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
}
-
name: Validate composer.json
run: Build/Scripts/runTests.sh -s composerValidate

-
name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer
Expand All @@ -40,27 +50,31 @@ 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:
-
uses: actions/checkout@v3
uses: actions/checkout@v4

-
name: Set up Docker Compose
run: |
docker-compose --version || {
echo "Docker Compose not found, installing..."
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
}
-
name: Validate composer.json
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerValidate

-
name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-${{ matrix.php-versions }}-typo3-${{ matrix.typo3-versions }}
Expand All @@ -80,27 +94,31 @@ 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:
-
uses: actions/checkout@v3
uses: actions/checkout@v4

-
name: Set up Docker Compose
run: |
docker-compose --version || {
echo "Docker Compose not found, installing..."
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
}
-
name: Validate composer.json
run: Build/Scripts/runTests.sh -p ${{ matrix.php-versions }} -t ${{ matrix.typo3-versions }} -s composerValidate

-
name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-${{ matrix.php-versions }}-typo3-${{ matrix.typo3-versions }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.Build
composer.lock
/var
/Build/.phpunit.result.cache
/Build/Testing/.phpunit.result.cache
/Build/Testing/.phpunit.cache/
/Build/testing-docker/.env
68 changes: 33 additions & 35 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 and 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 and 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 exists, else exit out with error
if ! type "docker" > /dev/null; then
echo "This script relies on docker and docker. 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
29 changes: 14 additions & 15 deletions Build/Testing/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" />
</php>
<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>
30 changes: 14 additions & 16 deletions Build/Testing/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" />
</php>
<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>
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 @@ -301,7 +300,7 @@ services:
php -v | grep '^PHP';
echo -n 'ec version: ';
.Build/bin/ec -version;
.Build/bin/ec -exclude .phpunit.result.cache .
.Build/bin/ec -exclude .phpunit.* .
"
unit:
Expand Down
Loading

0 comments on commit a26f27a

Please sign in to comment.