Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8f525e9
[TASK] Add TYPO3 v14 support
d-g-codappix Nov 9, 2026
30dba9c
Merge pull request #27 from extcode/7.x-dev
d-g-codappix Nov 9, 2026
5161983
[TASK] Use .Build as build directory
d-g-codappix Nov 14, 2026
7cae7ff
[TASK] Refactor tests to Build/Scripts directory
d-g-codappix Nov 14, 2026
0a9cca6
[TASK] Run yaml lint via Build/Scripts
d-g-codappix Nov 14, 2026
fc8fa01
[TASK] Run xml lint via Build/Scripts
d-g-codappix Nov 14, 2026
623c58a
[TASK] Run TypoScript lint via Build/Scripts
d-g-codappix Nov 14, 2026
75383c3
[TASK] Use valid SPDX license identifier
d-g-codappix Nov 14, 2026
3dc3570
Merge pull request #29 from extcode/build-scripts
d-g-codappix Nov 14, 2026
34417cd
[DOCS] Document supported versions
d-g-codappix Nov 14, 2026
150310d
Merge pull request #31 from extcode/document-supported-versions
d-g-codappix Nov 14, 2026
86d81f6
[BUGFIX] Ignore payment providers without clearing type
d-g-codappix Nov 14, 2026
0292d82
[BUGFIX] Respond to payment notification without template
d-g-codappix Nov 14, 2026
33ee4c6
[BUGFIX] Respect preventClearCart of the payment method
d-g-codappix Nov 14, 2026
8374e01
[TASK] Add unit and functional tests
d-g-codappix Nov 14, 2026
ec7d5e6
[TASK] Add command to measure the test coverage
d-g-codappix Nov 14, 2026
0d362ce
[TASK] Add functional tests for the redirect action
d-g-codappix Nov 14, 2026
de99479
[TASK] Register the event recorder of the tests via Services.php
d-g-codappix Nov 14, 2026
1a9ebf0
[TASK] Declare strict types in all PHP files
d-g-codappix Nov 14, 2026
7932107
[TASK] Check strict types declaration with php-cs-fixer
d-g-codappix Nov 14, 2026
23aa8e8
[TASK] Move service configuration to Services.php
d-g-codappix Nov 14, 2026
fe25243
[TASK] Use a descriptive service id for the email listener
d-g-codappix Nov 14, 2026
b9b4440
[DOCS] Fix required cart version in changelog of 6.0
d-g-codappix Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/.github/ export-ignore
/Build/ export-ignore
/Tests/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitlab-ci.yml export-ignore
/codeception.dist.yml export-ignore
/crowdin.yml export-ignore
/Makefile export-ignore
/rector.php export-ignore
/shell.nix export-ignore
/shell.nix export-ignore
95 changes: 88 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,58 @@ jobs:
tools: composer:v2

- name: PHP lint
run: "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
run: Build/Scripts/lint-php.sh

typoscript-linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: TypoScript lint
run: Build/Scripts/lint-typoscript.sh

xml-linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install xmllint
run: sudo apt-get update && sudo apt-get install -y libxml2-utils

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: XML lint
run: Build/Scripts/lint-xml.sh

yaml-linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install yamllint
run: pipx install yamllint

- name: YAML lint
run: Build/Scripts/lint-yaml.sh

documentation-rendering:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,7 +112,7 @@ jobs:
run: composer install --prefer-dist --no-progress --no-suggest

- name: Coding Guideline
run: vendor/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./
run: Build/Scripts/cgl.sh

code-quality:
runs-on: ubuntu-latest
Expand All @@ -71,13 +122,13 @@ jobs:
matrix:
include:
- php-version: '8.2'
typo3-version: '^13.4'
typo3-version: '^14.3'
- php-version: '8.3'
typo3-version: '^13.4'
typo3-version: '^14.3'
- php-version: '8.4'
typo3-version: '^13.4'
typo3-version: '^14.3'
- php-version: '8.5'
typo3-version: '^13.4'
typo3-version: '^14.3'
steps:
- uses: actions/checkout@v4

Expand All @@ -92,4 +143,34 @@ jobs:
composer require --no-interaction --prefer-dist --no-progress "typo3/cms-core:${{ matrix.typo3-version }}" "typo3/cms-extbase:${{ matrix.typo3-version }}" "typo3/cms-frontend:${{ matrix.typo3-version }}"

- name: Code Quality (by PHPStan)
run: vendor/bin/phpstan analyse -c Build/phpstan.neon
run: Build/Scripts/phpstan.sh

tests-unit-and-functional:
runs-on: ubuntu-latest
needs:
- coding-guideline
- code-quality
strategy:
matrix:
php-version:
- 8.2
- 8.3
- 8.4
- 8.5
steps:
- uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run unit tests
run: Build/Scripts/phpunit.sh unit

- name: Run functional tests
run: Build/Scripts/phpunit.sh functional
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.build
.Build
composer.lock

.php-cs-fixer.cache
Expand All @@ -11,7 +11,6 @@ Documentation-GENERATED-temp/
.idea

var/
vendor/

phpunit.coverage.xml
phpunit.report.xml
1 change: 1 addition & 0 deletions Build/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'declare_strict_types' => true,
'dir_constant' => true,
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
'modernize_strpos' => true,
Expand Down
20 changes: 20 additions & 0 deletions Build/Scripts/cgl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Checks the coding guidelines with php-cs-fixer.
#
# Usage:
# Build/Scripts/cgl.sh check only, fails on violations
# Build/Scripts/cgl.sh --fix fix the violations in place

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

requireBinary php-cs-fixer

FIXER_ARGS=(--config=Build/.php-cs-fixer.dist.php --using-cache=no)
if [ "${1:-}" = "--fix" ]; then
shift
else
FIXER_ARGS+=(-v --dry-run --diff)
fi

runPhp "${BIN_DIR}/php-cs-fixer" fix "${FIXER_ARGS[@]}" "$@"
35 changes: 35 additions & 0 deletions Build/Scripts/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
#
# Shared setup for all scripts in Build/Scripts.
#
# This file is sourced, not executed. It changes to the project root, so every
# script behaves the same no matter from where it has been called, and it
# provides the defaults all scripts rely on.
#
# Environment variables used as overrides:
# PHP_BIN php binary to use, defaults to "php"
# PHP_MEMORY_LIMIT memory_limit for all php calls, defaults to "-1"

set -euo pipefail

PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
readonly PROJECT_ROOT
cd "${PROJECT_ROOT}"

PHP_BIN="${PHP_BIN:-php}"
PHP_MEMORY_LIMIT="${PHP_MEMORY_LIMIT:--1}"
BIN_DIR="${PROJECT_ROOT}/.Build/bin"
readonly PHP_BIN PHP_MEMORY_LIMIT BIN_DIR

# Runs php with the configured memory limit, independent of the php.ini in use.
runPhp() {
"${PHP_BIN}" -d memory_limit="${PHP_MEMORY_LIMIT}" "$@"
}

# Fails with a readable message if composer install has not been run yet.
requireBinary() {
if [ ! -f "${BIN_DIR}/$1" ]; then
echo "Missing ${BIN_DIR}/$1, please run \"composer install\" first." >&2
exit 1
fi
}
63 changes: 63 additions & 0 deletions Build/Scripts/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
#
# Runs all phpunit tests and measures the code coverage of Classes/.
#
# Usage:
# Build/Scripts/coverage.sh [additional phpunit arguments]
#
# Every testsuite defined in Build/phpunit.xml.dist runs in its own phpunit
# process, like in phpunit.sh, the functional bootstrap leaks global state
# into the unit tests. The coverage of all suites is merged with phpcov, the
# summary is printed and the html report is written to
# .Build/coverage/index.html.
#
# Requirements:
# - php with xdebug or pcov
#
# Environment variables used as overrides:
# typo3DatabaseDriver database driver to test against, defaults to "pdo_sqlite"

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

requireBinary phpunit
requireBinary phpcov

if ! runPhp -r 'exit(extension_loaded("xdebug") || extension_loaded("pcov") ? 0 : 1);'; then
echo "Missing coverage driver, please enable xdebug or pcov." >&2
exit 1
fi

export typo3DatabaseDriver="${typo3DatabaseDriver:-pdo_sqlite}"
export XDEBUG_MODE=coverage

COVERAGE_PATH="${PROJECT_ROOT}/.Build/coverage"
COVERAGE_DATA_PATH="${COVERAGE_PATH}/data"
rm -rf "${COVERAGE_PATH}"
mkdir -p "${COVERAGE_DATA_PATH}"

mapfile -t SUITES < <(runPhp "${BIN_DIR}/phpunit" -c Build/phpunit.xml.dist --list-suites \
| sed -n 's/^ - \(.*\) ([0-9]\{1,\} tests\{0,1\})$/\1/p')

if [ ${#SUITES[@]} -eq 0 ]; then
echo "No testsuites found in Build/phpunit.xml.dist." >&2
exit 1
fi

STATUS=0
for suite in "${SUITES[@]}"; do
echo "Running testsuite \"${suite}\" ..."
runPhp "${BIN_DIR}/phpunit" \
-c Build/phpunit.xml.dist \
--testsuite "${suite}" \
--coverage-php "${COVERAGE_DATA_PATH}/${suite}.cov" \
"$@" || STATUS=$?
done

runPhp "${BIN_DIR}/phpcov" merge \
--text php://stdout \
--html "${COVERAGE_PATH}" \
"${COVERAGE_DATA_PATH}"

echo "HTML report: ${COVERAGE_PATH}/index.html"

exit "${STATUS}"
11 changes: 11 additions & 0 deletions Build/Scripts/lint-php.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Lints all php files of the extension for syntax errors.
#
# Usage:
# Build/Scripts/lint-php.sh

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

find ./*.php Classes Configuration Tests -name '*.php' -print0 \
| xargs -0 -n 1 -P 4 "${PHP_BIN}" -l
21 changes: 21 additions & 0 deletions Build/Scripts/lint-typoscript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Lints all TypoScript and TSconfig files of the extension with
# helmich/typo3-typoscript-lint, using Build/typoscriptlint.yaml.
# Warnings fail the lint as well.
#
# Usage:
# Build/Scripts/lint-typoscript.sh

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

requireBinary typoscript-lint

paths=()
for path in Configuration Tests ext_typoscript_setup.typoscript; do
if [ -e "${path}" ]; then
paths+=("${path}")
fi
done

runPhp "${BIN_DIR}/typoscript-lint" --config Build/typoscriptlint.yaml --fail-on-warnings "${paths[@]}"
27 changes: 27 additions & 0 deletions Build/Scripts/lint-xml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Validates the xml files of the extension against their schemas:
# - XLIFF files in Resources/Private/Language against XLIFF 1.2 strict
# (Build/xliff-core-1.2-strict.xsd, imports Build/xml.xsd)
# - Build/phpunit.xml.dist against the schema of the installed PHPUnit
#
# xmllint is not installed via composer. It is provided by shell.nix, in CI it
# is installed via apt (libxml2-utils).
#
# Usage:
# Build/Scripts/lint-xml.sh

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

if ! command -v xmllint > /dev/null; then
echo "Missing xmllint, please install it first, e.g. the package libxml2-utils." >&2
exit 1
fi
requireBinary phpunit

if [ -d Resources/Private/Language ]; then
find Resources/Private/Language -name '*.xlf' -print0 \
| xargs -0 -r xmllint --schema Build/xliff-core-1.2-strict.xsd --noout
fi

xmllint --schema .Build/vendor/phpunit/phpunit/phpunit.xsd --noout Build/phpunit.xml.dist
19 changes: 19 additions & 0 deletions Build/Scripts/lint-yaml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
#
# Lints all yaml files of the extension with yamllint, using
# Build/yamllint.yaml. Files ignored by .gitignore are skipped.
#
# yamllint is not installed via composer. It is provided by shell.nix, in CI it
# is installed via pipx.
#
# Usage:
# Build/Scripts/lint-yaml.sh

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

if ! command -v yamllint > /dev/null; then
echo "Missing yamllint, please install it first, e.g. \"pipx install yamllint\"." >&2
exit 1
fi

yamllint --config-file Build/yamllint.yaml .
12 changes: 12 additions & 0 deletions Build/Scripts/phpstan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# Runs the static code analysis with phpstan.
#
# Usage:
# Build/Scripts/phpstan.sh [additional phpstan arguments]

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

requireBinary phpstan

runPhp "${BIN_DIR}/phpstan" analyse -c Build/phpstan.neon "$@"
Loading
Loading