Skip to content

Commit

Permalink
Update PHPUnit to 8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Dec 8, 2021
1 parent b9b156e commit 2ce2dfa
Show file tree
Hide file tree
Showing 58 changed files with 1,499 additions and 862 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -96,24 +96,6 @@ jobs:
if: "matrix.dependencies == 'locked'"
run: "composer install ${{ env.COMPOSER_FLAGS }}"

- name: "Require latest PHPUnitBridge for PHP 8.x"
if: "startsWith(matrix.php-version, '8.')"
# using ~ here to avoid issues with windows CLI removing the ^
run: 'composer require --no-update --dev "symfony/phpunit-bridge:~5.2"'

# temporary fix until phpunit-bridge has a release supporting 8.1
- name: "Require latest dev PHPUnitBridge for PHP 8.1"
if: "matrix.experimental"
# using ~ here to avoid issues with windows CLI removing the ^
run: 'composer require --no-update --dev "symfony/phpunit-bridge:~5.4@dev"'

- name: "Set ignored deprecations for php 8.1+ on lowest or locked deps"
if: "matrix.php-version >= '8.1' && !contains(matrix.dependencies, 'highest')"
run: "echo \"SYMFONY_DEPRECATIONS_HELPER=baselineFile=./tests/deprecations-8.1.json&max[direct]=0\" >> $GITHUB_ENV"

- name: "Update dev requirements to latest available for the current PHP even on locked builds as they are not bundled dependencies"
run: "composer update ${{ env.COMPOSER_FLAGS }} symfony/phpunit-bridge phpspec/prophecy phpdocumentor/* sebastian/* doctrine/instantiator"

- name: "Run install again using composer binary from source"
run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"

Expand All @@ -125,11 +107,11 @@ jobs:

- name: "Run tests"
if: "matrix.php-version != '7.3'"
run: "vendor/bin/simple-phpunit --verbose"
run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --verbose"

- name: "Run complete test suite on 7.3"
if: "matrix.php-version == '7.3'"
run: "vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml"
run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml"

validation:
name: "Composer validation"
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/phpstan.yml
Expand Up @@ -49,9 +49,5 @@ jobs:
- name: "Install highest dependencies from composer.json using composer binary provided by system"
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"

- name: "Install PHPStan"
# Locked to phpunit 7.5 here as newer ones have void return types which break inheritance
run: "bin/composer require --dev phpstan/phpstan:^1.0 phpstan/phpstan-phpunit:^1.0 phpstan/phpstan-deprecation-rules:^1 phpstan/phpstan-strict-rules:^1 phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}"

- name: "Run PHPStan"
run: "vendor/bin/phpstan analyse --configuration=phpstan/config.neon"
run: "composer phpstan"
16 changes: 9 additions & 7 deletions composer.json
Expand Up @@ -41,7 +41,12 @@
},
"require-dev": {
"symfony/phpunit-bridge": "^5.4 || ^6.0",
"phpspec/prophecy": "^1.10"
"phpspec/prophecy": "^1.10",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1",
"phpstan/phpstan-strict-rules": "^1",
"phpunit/phpunit": "^8.5"
},
"suggest": {
"ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
Expand Down Expand Up @@ -79,12 +84,9 @@
],
"scripts": {
"compile": "@php -dphar.readonly=0 bin/compile",
"test": "@php simple-phpunit",
"phpstan-setup": [
"@composer config platform --unset",
"@composer update",
"@composer require --dev phpstan/phpstan:^1.0 phpstan/phpstan-phpunit:^1.0 phpstan/phpstan-deprecation-rules:^1 phpstan/phpstan-strict-rules:^1 phpunit/phpunit:^7.5.20 --with-all-dependencies",
"git checkout composer.json composer.lock"
"test": [
"@putenv SYMFONY_PHPUNIT_VERSION=8.5",
"@php simple-phpunit"
],
"phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon"
},
Expand Down

0 comments on commit 2ce2dfa

Please sign in to comment.