Skip to content

Commit

Permalink
Merge pull request #39 from creative-commoners/pulls/1.2/show-depreca…
Browse files Browse the repository at this point in the history
…tions

ENH Show deprecations in phpunit 11.3.3 and above
  • Loading branch information
GuySartorelli authored Sep 9, 2024
2 parents d74489d + 535cf0b commit 57469f7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,20 @@ runs:
PHPUNIT_SUITE: ${{ inputs.phpunit_suite }}
run: |
PHPUNIT_OPTIONS="--colors=always"
[[ $(vendor/bin/phpunit --version) =~ ([0-9]+)\.[0-9]+\.[0-9] ]]
PHPUNIT_MAJOR_VERSION=${BASH_REMATCH[1]}
if (( "$PHPUNIT_MAJOR_VERSION" <= 9 )); then
[[ $(vendor/bin/phpunit --version) =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
INT_VERSION=$(( $MAJOR * 10000 + $MINOR * 100 + $PATCH ))
if (( "$INT_VERSION" < 100000 )); then
# --verbose option removed in PHPUnit 10, as it's now always verbose
PHPUNIT_OPTIONS="$PHPUNIT_OPTIONS --verbose"
fi
# --display-phpunit-deprecations option added in PHPUnit 11.3.3
# deprecations will display by default in PHPUnit <= 11.3.2
if (( "$INT_VERSION" >= 110303 )); then
PHPUNIT_OPTIONS="$PHPUNIT_OPTIONS --display-phpunit-deprecations"
fi
if [[ "$PHPUNIT_SUITE" != "all" ]] && [[ "$PHPUNIT_SUITE" != "" ]]; then
PHPUNIT_OPTIONS="$PHPUNIT_OPTIONS --testsuite "$PHPUNIT_SUITE""
fi
Expand Down

0 comments on commit 57469f7

Please sign in to comment.