summaryrefslogtreecommitdiffstats
path: root/php-mock2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-02-13 14:12:35 +0100
committerRemi Collet <remi@php.net>2023-02-13 14:12:35 +0100
commitb52a75823634b606334bc104deb09054bdba91eb (patch)
tree8469f4ddc9ad57fb0232c474fab2edf1d607c839 /php-mock2.spec
parentc2062d14cba62f2ac223cd6b0fc494166454d968 (diff)
update to 2.4.0
allow phpunit10
Diffstat (limited to 'php-mock2.spec')
-rw-r--r--php-mock2.spec71
1 files changed, 45 insertions, 26 deletions
diff --git a/php-mock2.spec b/php-mock2.spec
index fd79de9..4691d74 100644
--- a/php-mock2.spec
+++ b/php-mock2.spec
@@ -1,12 +1,12 @@
# remirepo/fedora spec file for php-mock2
#
-# Copyright (c) 2016-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2016-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit 9a55bd8ba40e6da2e97a866121d2c69dedd4952b
+%global gh_commit 6f71999665d27fbdf684c1639981e96eff540b5f
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner php-mock
%global gh_project php-mock
@@ -14,7 +14,7 @@
%global major 2
Name: php-mock%{major}
-Version: 2.3.1
+Version: 2.4.0
Release: 1%{?dist}
Summary: PHP-Mock can mock built-in PHP functions
@@ -23,33 +23,26 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
BuildArch: noarch
-BuildRequires: php(language) >= 5.6
+# 7.4 because of phpunit9
+BuildRequires: php(language) >= 7.4
%if %{with_tests}
# from composer.json, "require-dev": {
-# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0",
+# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0",
# "squizlabs/php_codesniffer": "^3.5"
-# remirepo:1
-%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 3)
+BuildRequires: phpunit8
BuildRequires: phpunit9
-%global phpunit %{_bindir}/phpunit9
-# remirepo:5
-%else
-BuildRequires: php-phpunit-Text-Template
-BuildRequires: php-phpunit-PHPUnit >= 5.7
-%global phpunit %{_bindir}/phpunit
-%endif
+# TODO phpunit10 but requires php 8.1
%endif
# For autoloader
BuildRequires: php-composer(fedora/autoloader)
# from composer.json, "require": {
# "php": "^5.6 || ^7.0 || ^8.0",
-# "phpunit/php-text-template": "^1"
+# "phpunit/php-text-template": "^1 || ^2 || ^3")
Requires: php(language) >= 5.6
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 3)
+Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 4)
# remirepo:3
%else
Requires: php-phpunit-Text-Template
@@ -98,6 +91,7 @@ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', dirname(dirname(__DIR__)) . '/tests/phpmock%{major}');
\Fedora\Autoloader\Dependencies::required([
[
+ '%{_datadir}/php/SebastianBergmann/Template3/autoload.php',
'%{_datadir}/php/SebastianBergmann/Template2/autoload.php',
'%{_datadir}/php/Text/Template/Autoload.php',
]
@@ -129,14 +123,35 @@ cp -pr rpm/tests %{buildroot}%{_datadir}/tests
ret=0
# testDefiningAfterCallingUnqualified and testEnable may fail locally (ok in mock)
-for cmdarg in "php %{phpunit}" php74 php80 php81;do
- if which $cmdarg; then
- set $cmdarg
- $1 ${2:-%{_bindir}/phpunit9} \
- --filter '^((?!(testDefiningAfterCallingUnqualified|testEnable)).)*$' \
- --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose rpm/tests || ret=1
- fi
-done
+if [ -x %{_bindir}/phpunit8 ]; then
+ for cmd in php php80 php81 php82;do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit8 \
+ --filter '^((?!(testDefiningAfterCallingUnqualified|testEnable)).)*$' \
+ --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose rpm/tests || ret=1
+ fi
+ done
+fi
+
+if [ -x %{_bindir}/phpunit9 ]; then
+ for cmd in php php80 php81 php82;do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit9 \
+ --filter '^((?!(testDefiningAfterCallingUnqualified|testEnable)).)*$' \
+ --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose rpm/tests || ret=1
+ fi
+ done
+fi
+
+if [ -x %{_bindir}/phpunit10 ]; then
+ for cmd in php php81 php82;do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit10 \
+ --filter '^((?!(testDefiningAfterCallingUnqualified|testEnable)).)*$' \
+ --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php rpm/tests || ret=1
+ fi
+ done
+fi
exit $ret
%else
: bootstrap build with test suite disabled
@@ -154,6 +169,10 @@ exit $ret
%changelog
+* Mon Feb 13 2023 Remi Collet <remi@remirepo.net> - 2.4.0-1
+- update to 2.4.0
+- allow phpunit10
+
* Tue Feb 8 2022 Remi Collet <remi@remirepo.net> - 2.3.1-1
- update to 2.3.1