From 8c7da2fd4ea1c17e6d5578adb5777da9e720db21 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 6 Nov 2020 09:08:25 +0100 Subject: add patch for PHP 8 from merged PR https://github.com/ramsey/uuid/pull/352 switch to phpunit9 https://github.com/ramsey/uuid/pull/350 ignore 1 test with erratic result from review #1884542 --- php-ramsey-uuid.spec | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'php-ramsey-uuid.spec') diff --git a/php-ramsey-uuid.spec b/php-ramsey-uuid.spec index c34c107..f9317b9 100644 --- a/php-ramsey-uuid.spec +++ b/php-ramsey-uuid.spec @@ -23,7 +23,7 @@ Name: php-%{pk_vendor}-%{pk_name} Version: 4.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library for generating and working with UUIDs License: MIT @@ -34,6 +34,7 @@ Source1: makesrc.sh # don't use codeception/aspect-mock Patch0: %{name}-tests.patch +Patch1: https://patch-diff.githubusercontent.com/raw/ramsey/uuid/pull/352.patch BuildArch: noarch @@ -77,7 +78,14 @@ BuildRequires: php-brick-math >= 0.8 BuildRequires: php-ramsey-collection >= 1.0 BuildRequires: php-mockery >= 1.3 %endif +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 +# https://github.com/ramsey/uuid/pull/350 +BuildRequires: phpunit9 +%global phpunit %{_bindir}/phpunit9 +%else BuildRequires: phpunit8 >= 8.5 +%global phpunit %{_bindir}/phpunit8 +%endif %endif # Autoloader BuildRequires: php-fedora-autoloader-devel @@ -122,6 +130,7 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm +%patch1 -p1 -b .pr352 %build @@ -161,14 +170,17 @@ EOF : Ignore tests using missing mocking libraries find tests -type f -exec grep -Eq '(PHPMockery|Aspec|Moontoast)' {} \; -delete -print +: Ignore test with erratic result on Koji +FILTER="--filter '^((?!(testSerializationOfNodeProviderCollection)).)*$'" + : Run upstream test suite ret=0 -# TODO php 8: phpunit and mockery not compatible -for cmd in php php73 php74; do - if which $cmd; then - $cmd %{_bindir}/phpunit8 \ - --no-coverage \ - --verbose || ret=1 +for cmdarg in "php %{?phpunit}" php73 php74 php80; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit9} \ + --no-coverage \ + --verbose $FILTER || ret=1 fi done exit $ret @@ -186,5 +198,12 @@ exit $ret %changelog +* Fri Nov 6 2020 Remi Collet - 4.1.1-2 +- add patch for PHP 8 from merged PR + https://github.com/ramsey/uuid/pull/352 +- switch to phpunit9 + https://github.com/ramsey/uuid/pull/350 +- ignore 1 test with erratic result from review #1884542 + * Fri Oct 2 2020 Remi Collet - 4.1.1-1 - initial package -- cgit