summaryrefslogtreecommitdiffstats
path: root/phpunit7.spec
diff options
context:
space:
mode:
Diffstat (limited to 'phpunit7.spec')
-rw-r--r--phpunit7.spec104
1 files changed, 79 insertions, 25 deletions
diff --git a/phpunit7.spec b/phpunit7.spec
index c11a8fc..2858e02 100644
--- a/phpunit7.spec
+++ b/phpunit7.spec
@@ -1,17 +1,18 @@
# remirepo/fedora spec file for phpunit7
#
-# Copyright (c) 2010-2020 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
-%global gh_commit 4263f76a3fc65385e242ef7357b99f3bed36707e
+%global gh_commit 9467db479d1b0487c99733bb1e7944d32deded2c
#global gh_date 20150927
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_vendor sebastianbergmann
@@ -24,20 +25,23 @@
%global php_home %{_datadir}/php
%global ver_major 7
%global ver_minor 5
-%global ver_patch 19
-%global specrel 1
+%global ver_patch 20
Name: %{pk_project}%{ver_major}
Version: %{ver_major}.%{ver_minor}.%{ver_patch}
-Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
+Release: 13%{?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
# Fix command for autoload
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
@@ -63,8 +67,8 @@ BuildRequires: (php-composer(sebastian/version) >= 2.0.1 with php-co
BuildRequires: (php-composer(phpunit/php-invoker) >= 2.0 with php-composer(phpunit/php-invoker) < 3)
# remirepo:20
%else
-BuildRequires: php-doctrine-instantiator11
-BuildRequires: php-myclabs-deep-copy19
+BuildRequires: php-doctrine-instantiator >= 1.1
+BuildRequires: php-myclabs-deep-copy >= 1.7
BuildRequires: php-phar-io-manifest >= 1.0.1
BuildRequires: php-phar-io-version >= 1.0
BuildRequires: php-phpspec-prophecy >= 1.7
@@ -145,10 +149,13 @@ Requires: (php-composer(sebastian/version) >= 2.0.1 with php-co
# "phpunit/php-invoker": "^2.0",
# "ext-xdebug": "*"
Requires: (php-composer(phpunit/php-invoker) >= 2.0 with php-composer(phpunit/php-invoker) < 3)
+# Supported versions
+Recommends: phpunit8
+Recommends: phpunit9
# remirepo:20
%else
-Requires: php-doctrine-instantiator11
-Requires: php-myclabs-deep-copy19
+Requires: php-doctrine-instantiator >= 1.1
+Requires: php-myclabs-deep-copy >= 1.7
Requires: php-phar-io-manifest >= 1.0.1
Requires: php-phar-io-version >= 1.0
Requires: php-phpspec-prophecy >= 1.7
@@ -178,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.
@@ -186,12 +198,21 @@ It is an instance of the xUnit architecture for unit testing frameworks.
This package provides the version %{ver_major} of PHPUnit,
available using the %{name} command.
+This version have reached its end of life in Feb 2020,
+so consider using a supported version,
+see https://phpunit.de/supported-versions.html
+
Documentation: https://phpunit.readthedocs.io/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p0 -b .rpm
+%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
@@ -207,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',
@@ -216,17 +236,13 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/SebastianBergmann/ObjectEnumerator3/autoload.php',
'%{php_home}/SebastianBergmann/ResourceOperations2/autoload.php',
'%{php_home}/SebastianBergmann/Version/autoload.php',
- [
- '%{php_home}/Doctrine/Instantiator11/autoload.php',
- '%{php_home}/Doctrine/Instantiator/autoload.php',
- ],
- [
- '%{php_home}/DeepCopy19/autoload.php',
- '%{php_home}/DeepCopy/autoload.php',
- ],
+ '%{php_home}/Doctrine/Instantiator/autoload.php',
+ '%{php_home}/DeepCopy/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([
@@ -252,15 +268,26 @@ install -p -m 644 phpunit.xsd %{buildroot}%{php_home}/%{ns_vendor}/phpunit.xsd
%check
-OPT="--testsuite=unit --no-coverage"
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 php71 php72 php73 php74; do
+for cmd in php php81 php82 php83; do
if which $cmd; then
- if [ $($cmd -r 'echo PHP_VERSION_ID;') -ge 70400 ]; then
- OPT="$OPT --filter '^((?!(testStaticAttributesBackupPre)).)*$'"
+ OPT="--testsuite=unit --no-coverage"
+ VER=$($cmd -r 'echo PHP_VERSION_ID;');
+
+ if [ $VER -ge 70400 ]; then
+ FILTER="testStaticAttributesBackupPre"
+ fi
+ if [ $VER -ge 80000 ]; then
+ FILTER="$FILTER|testCountTraversable|testConstraintTraversableCheckForObjectIdentityForDefaultCase"
+ fi
+ if [ $VER -ge 80300 ]; then
+ FILTER="$FILTER|testMessageXdebugScreamCompatibility|testGetOriginalException|testNoOriginalExceptionInStacktrace|testIsInIsolationReturnsTrue"
+ fi
+ if [ -n "$FILTER" ]; then
+ OPT="$OPT --filter '^((?!($FILTER)).)*$'"
fi
$cmd ./phpunit $OPT --verbose || ret=1
fi
@@ -279,6 +306,33 @@ exit $ret
%changelog
+* Fri Dec 22 2023 Remi Collet <remi@remirepo.net> - 7.5.20-13
+- 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
+
+* Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 7.5.20-7
+- add minimal patch for PHP 8.1
+
+* Fri Mar 26 2021 Remi Collet <remi@remirepo.net> - 7.5.20-5
+- more fix for PHP 8
+
+* Thu Mar 25 2021 Remi Collet <remi@remirepo.net> - 7.5.20-4
+- recommend using a supported version
+
+* Wed Mar 24 2021 Remi Collet <remi@remirepo.net> - 7.5.20-3
+- add minimal patch for PHP 8 and ignore some tests
+
+* Mon Jun 29 2020 Remi Collet <remi@remirepo.net> - 7.5.20-2
+- cleanup dependencies
+
+* Wed Jan 8 2020 Remi Collet <remi@remirepo.net> - 7.5.20-1
+- update to 7.5.20
+
* Tue Jan 7 2020 Remi Collet <remi@remirepo.net> - 7.5.19-1
- update to 7.5.19