summaryrefslogtreecommitdiffstats
path: root/phpunit7.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-12-22 14:25:01 +0100
committerRemi Collet <remi@php.net>2023-12-22 14:25:01 +0100
commitcb1c59a002f442843b6959aaac8b4a26eb37c279 (patch)
tree87da126ba58b5167ffeca8176df238d0375472bf /phpunit7.spec
parent8dc28e30cb14ba9c19845b858b7ab7b6d79d8088 (diff)
fix possible autoloader issue with phpspec/prophecy
Diffstat (limited to 'phpunit7.spec')
-rw-r--r--phpunit7.spec38
1 files changed, 29 insertions, 9 deletions
diff --git a/phpunit7.spec b/phpunit7.spec
index 38db195..be6b244 100644
--- a/phpunit7.spec
+++ b/phpunit7.spec
@@ -1,13 +1,14 @@
# remirepo/fedora spec file for phpunit7
#
-# Copyright (c) 2010-2021 Remi Collet
+# Copyright (c) 2010-2023 Remi Collet
#
-# License: CC-BY-SA
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+# remirepo:2
# For compatibility with SCL
%undefine __brp_mangle_shebangs
@@ -28,10 +29,10 @@
Name: %{pk_project}%{ver_major}
Version: %{ver_major}.%{ver_minor}.%{ver_patch}
-Release: 8%{?dist}
+Release: 12%{?dist}
Summary: The PHP Unit Testing framework version %{ver_major}
-License: BSD
+License: BSD-3-Clause
URL: https://github.com/%{gh_vendor}/%{gh_project}
Source0: https://github.com/%{gh_vendor}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
@@ -39,6 +40,8 @@ Source0: https://github.com/%{gh_vendor}/%{gh_project}/archive/%{gh_commi
Patch0: %{name}-rpm.patch
# Minimal fix for PHP 8
Patch1: %{name}-php8.patch
+# Fix for new comparator
+Patch2: %{name}-comp.patch
BuildArch: noarch
BuildRequires: php(language) >= 7.1
@@ -182,6 +185,11 @@ Requires: php-spl
# projects have been merged
Obsoletes: php-phpunit-mock-objects6 < 6.1.3
+%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
+Provides: php-composer(phpunit/phpunit) = %{version}
+Provides: phpunit = %{version}-%{release}
+%endif
+
%description
PHPUnit is a programmer-oriented testing framework for PHP.
@@ -199,10 +207,13 @@ Documentation: https://phpunit.readthedocs.io/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p1 -b .rpm
-%patch1 -p1 -b .php8
+%patch -P0 -p1 -b .rpm
+%patch -P1 -p1 -b .php8
+%patch -P2 -p1 -b .comp
find . -name \*.php8 -delete -print
+find . -name \*.comp -delete -print
+
%build
%{_bindir}/phpab \
@@ -217,7 +228,6 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/Text/Template/Autoload.php',
'%{php_home}/SebastianBergmann/CodeCoverage6/autoload.php',
'%{php_home}/SebastianBergmann/Timer/autoload.php',
- '%{php_home}/Prophecy/autoload.php',
'%{php_home}/SebastianBergmann/Diff3/autoload.php', // Before comparator which may load v2
'%{php_home}/SebastianBergmann/Comparator3/autoload.php',
'%{php_home}/SebastianBergmann/Environment4/autoload.php',
@@ -231,6 +241,8 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/SebastianBergmann/Invoker/autoload.php',
'%{php_home}/PharIo/Manifest/autoload.php',
'%{php_home}/PharIo/Version/autoload.php',
+ // May load Comparator/RecursionContext bad version
+ '%{php_home}/Prophecy/autoload.php',
]);
// Extensions
\Fedora\Autoloader\Dependencies::optional([
@@ -260,7 +272,7 @@ sed -e 's:@PATH@:%{buildroot}%{php_home}/%{ns_vendor}:' -i tests/bootstrap.php
sed -e 's:%{php_home}/%{ns_vendor}:%{buildroot}%{php_home}/%{ns_vendor}:' -i phpunit
ret=0
-for cmd in php php73 php74 php80 php81; do
+for cmd in php php81 php82 php83; do
if which $cmd; then
OPT="--testsuite=unit --no-coverage"
VER=$($cmd -r 'echo PHP_VERSION_ID;');
@@ -270,7 +282,9 @@ for cmd in php php73 php74 php80 php81; do
fi
if [ $VER -ge 80000 ]; then
FILTER="$FILTER|testCountTraversable|testConstraintTraversableCheckForObjectIdentityForDefaultCase"
- OPT="$OPT --filter '^((?!($FILTER)).)*$'"
+ fi
+ if [ $VER -ge 80300 ]; then
+ FILTER="$FILTER|testMessageXdebugScreamCompatibility|testGetOriginalException|testNoOriginalExceptionInStacktrace|testIsInIsolationReturnsTrue"
fi
if [ -n "$FILTER" ]; then
OPT="$OPT --filter '^((?!($FILTER)).)*$'"
@@ -292,6 +306,12 @@ exit $ret
%changelog
+* Fri Dec 22 2023 Remi Collet <remi@remirepo.net> - 7.5.20-12
+- fix possible autoloader issue with phpspec/prophecy
+
+* Mon Sep 26 2022 Remi Collet <remi@remirepo.net> - 7.5.20-11
+- backport upstream fix for new sebastian/comparator
+
* Tue Nov 23 2021 Remi Collet <remi@remirepo.net> - 7.5.20-8
- additional fix for PHP 8