Skip to content

Commit 75072a3

Browse files
committed
Update phpunit a little to decide when to fail on deprecations
PHPUnit 10.5.47 and later know the flag `--do-not-fail-on-deprecation`, which allows us to make it not exit with code 1 in case of deprecations on the second run of the script. That second run uses the lowest valid dependencies, which might contain deprecations when used with newer versions of PHP, but still are acceptable versions, and should not make our tests fail.
1 parent 056d03f commit 75072a3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.ci/run_tests.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ composer require $COMPOSER_ARGS "kolab/net_ldap3:~1.1.4" --no-update
1010
composer update $COMPOSER_ARGS --prefer-dist --no-interaction --no-progress
1111

1212
# Execute tests.
13-
vendor/bin/phpunit -c tests/phpunit.xml --fail-on-warning --fail-on-risky
13+
vendor/bin/phpunit -c tests/phpunit.xml --fail-on-warning --fail-on-risky --display-deprecations
1414

1515
# Downgrade dependencies to the lowest versions.
1616
composer update $COMPOSER_ARGS --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress --optimize-autoloader
1717

18-
# Execute tests again.
19-
vendor/bin/phpunit -c tests/phpunit.xml --fail-on-warning --fail-on-risky
18+
# Execute tests again. We do not want this run to fail due to deprecations though, because those can only occur from
19+
# (older) dependencies, which we migh still consider good enough.
20+
vendor/bin/phpunit -c tests/phpunit.xml --fail-on-warning --fail-on-risky --display-deprecations --do-not-fail-on-deprecation

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"phpstan/phpstan": "^2.0",
2727
"phpstan/phpstan-deprecation-rules": "^2.0",
2828
"phpstan/phpstan-strict-rules": "^2.0",
29-
"phpunit/phpunit": "^10.5.45 || ^11.0",
29+
"phpunit/phpunit": "^10.5.47 || ^11.0",
3030
"roundcube/acl": "*",
3131
"roundcube/additional_message_headers": "*",
3232
"roundcube/archive": "*",

0 commit comments

Comments
 (0)