diff options
-rw-r--r-- | php-sabre-vobject4.spec | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/php-sabre-vobject4.spec b/php-sabre-vobject4.spec index 932b6ae..25329b1 100644 --- a/php-sabre-vobject4.spec +++ b/php-sabre-vobject4.spec @@ -56,7 +56,13 @@ BuildRequires: php-xml # "friendsofphp/php-cs-fixer": "~2.16.1", # "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", # "phpstan/phpstan": "^0.12" -BuildRequires: phpunit8 >= 8.5 +%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9 +BuildRequires: phpunit9 +%global phpunit %{_bindir}/phpunit9 +%else +BuildRequires: phpunit8 +%global phpunit %{_bindir}/phpunit8 +%endif # Autoloader BuildRequires: php-composer(fedora/autoloader) %endif @@ -140,9 +146,10 @@ fi : Run upstream test suite against installed library ret=0 -for cmd in php php72 php73 php74 php80; do - if which $cmd; then - $cmd %{_bindir}/phpunit8 $opt || ret=1 +for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit9} $opt || ret=1 fi done exit $ret |