From 5e9bf2d5e9b6be13fac12c7baf47b546e6aef309 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 24 Jul 2024 19:18:45 +0200 Subject: [PATCH] Upgrade PHPUnit and add PHP 8.4 to CI --- .github/workflows/test-application.yaml | 18 +++++++++++++++--- composer.json | 5 ++++- phpunit-9.xml.dist | 24 ++++++++++++++++++++++++ phpunit.xml.dist | 24 ++++++++++++------------ 4 files changed, 55 insertions(+), 16 deletions(-) create mode 100644 phpunit-9.xml.dist diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 023c2ec3..237879c4 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -22,12 +22,14 @@ jobs: - php-version: '7.2' dependency-versions: 'lowest' tools: 'composer:v2' + phpunit-config: 'phpunit-9.xml.dist' env: SYMFONY_DEPRECATIONS_HELPER: disabled - php-version: '7.4' dependency-versions: 'highest' tools: 'composer:v2' + phpunit-config: 'phpunit-9.xml.dist' env: SYMFONY_DEPRECATIONS_HELPER: disabled @@ -55,6 +57,13 @@ jobs: env: SYMFONY_DEPRECATIONS_HELPER: weak + - php-version: '8.4' + dependency-versions: 'highest' + tools: 'composer:v2' + composer-options: '--ignore-platform-reqs' + env: + SYMFONY_DEPRECATIONS_HELPER: weak + services: mysql: image: mysql:5.7 @@ -79,20 +88,23 @@ jobs: if: ${{ matrix.php-version == '7.2' }} run: composer remove phpspec/prophecy-phpunit --no-update --dev - - name: Remove not required test tooling - run: composer remove "*php-cs-fixer*" "*phpstan*" --no-update --dev + - name: Remove Lint Tools + # These tools are not required to run tests, so we are removing them to improve dependency resolving and + # testing lowest versions. + run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update - name: Install composer dependencies uses: ramsey/composer-install@v2 with: dependency-versions: ${{matrix.dependency-versions}} + composer-options: ${{ matrix.composer-options }} - name: Bootstrap test environment run: composer bootstrap-test-environment env: ${{ matrix.env }} - name: Execute test cases - run: composer test + run: composer test -- --config ${{ matrix.phpunit-config || 'phpunit.xml.dist' }} env: ${{ matrix.env }} lint: diff --git a/composer.json b/composer.json index 4a11afa6..e4336436 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,9 @@ "license": "MIT", "require": { "php": "^7.2 || ^8.0", + "doctrine/collections": "^1.0 || ^2.0", + "doctrine/orm": "^2.5.3", + "doctrine/persistence": "^1.3.0 || ^2.0 || ^3.0", "friendsofsymfony/rest-bundle": "^2.6 || ^3.0", "sulu/sulu": "^2.4 || ^2.5@dev", "symfony/config": "^4.4 || ^5.4 || ^6.0 || ^7.0", @@ -27,7 +30,7 @@ "phpstan/phpstan-doctrine": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-symfony": "^1.0", - "phpunit/phpunit": "^8.0 ||^9.6", + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.0", "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0 || ^7.0", "symfony/dotenv": "^4.4 || ^5.4 || ^6.0 || ^7.0", "symfony/form": "^4.4 || ^5.4 || ^6.0 || ^7.0", diff --git a/phpunit-9.xml.dist b/phpunit-9.xml.dist new file mode 100644 index 00000000..814b7958 --- /dev/null +++ b/phpunit-9.xml.dist @@ -0,0 +1,24 @@ + + + + + ./Tests + + + + + + . + + Resources/ + Tests/ + vendor/ + + + + + + + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e2441082..dcad3b65 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,23 @@ - + ./Tests - - - . - - Resources/ - Tests/ - vendor/ - - - - + + + + ./ + + + Resources/ + Tests/ + vendor/ + +