From a546dbc5f1f57fcd5fa70cd4278366c6374b2748 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 3 Nov 2021 20:36:49 +0100 Subject: [PATCH 1/2] PHPUnit: update configuration PHPUnit recently released version 9.5.10 (and 8.5.21). This contains a particular (IMO breaking) change: > * PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) Let's unpack this: Previously (PHPUnit < 9.5.10/8.5.21), if PHPUnit would encounter a PHP native deprecation notice, it would: 1. Show a test which causes a deprecation notice to be thrown as **"errored"**, 2. Show the **first** deprecation notice it encountered and 3. PHPUnit would exit with a **non-0 exit code** (2), which will fail a CI build. As of PHPUnit 9.5.10/8.5.21, if PHPUnit encounters a PHP native deprecation notice, it will no longer do so. Instead PHPUnit will: 1. Show a test which causes a PHP deprecation notice to be thrown as **"risky"**, 2. Show the **all** deprecation notices it encountered and 3. PHPUnit will exit with a **0 exit code**, which will show a CI build as passing. This commit reverts PHPUnit to the previous behaviour by adding `convertDeprecationsToExceptions="true"` to the PHPUnit configuration. It also adds the other related directives for consistency. Refs: * https://github.com/sebastianbergmann/phpunit/blob/9.5/ChangeLog-8.5.md * https://github.com/sebastianbergmann/phpunit/blob/9.5/ChangeLog-9.5.md --- phpunit.xml.dist | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9c251d1..5d2f6f3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,13 @@ - - + ./tests/ From b843a391859ae5eda4c1a5368fe379d101f1818a Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 4 Nov 2021 01:49:18 +0100 Subject: [PATCH 2/2] .gitignore: add PHPUnit cache file Since PHPUnit 8.x, PHPUnit generates a cache file. This file should not be committed. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a79486f..3f9053a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor composer.lock phpunit.xml +.phpunit.result.cache