diff options
| -rw-r--r-- | php-phpspec-prophecy.spec | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/php-phpspec-prophecy.spec b/php-phpspec-prophecy.spec index 69b1a37..81f6a35 100644 --- a/php-phpspec-prophecy.spec +++ b/php-phpspec-prophecy.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for php-phpspec-prophecy # -# SPDX-FileCopyrightText: Copyright 2015-2025 Remi Collet +# SPDX-FileCopyrightText: Copyright 2015-2026 Remi Collet # SPDX-License-Identifier: CECILL-2.1 # http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # @@ -16,7 +16,7 @@ Name: php-phpspec-prophecy Version: 1.24.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Highly opinionated mocking framework for PHP License: MIT @@ -30,7 +30,16 @@ BuildRequires: php(language) >= 8.2 BuildRequires: (php-composer(phpdocumentor/reflection-docblock) >= 5.2 with php-composer(phpdocumentor/reflection-docblock) < 6) BuildRequires: (php-composer(sebastian/comparator) >= 3.0 with php-composer(sebastian/comparator) < 8) BuildRequires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 8) +%if 0 BuildRequires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 3) +# remirepo:7 +%else +%if 0%{?fedora} >= 42 +BuildRequires: php-doctrine-instantiator2 +%else +BuildRequires: php-doctrine-instantiator >= 1.2 +%endif +%endif # from composer.json, "require-dev": { # "friendsofphp/php-cs-fixer": "^3.88", # "phpspec/phpspec": "^6.0 || ^7.0 || ^8.0", @@ -40,8 +49,10 @@ BuildRequires: (php-composer(doctrine/instantiator) >= 1.2 with p BuildRequires: php-composer(phpspec/phpspec) >= 6.0 %endif BuildRequires: phpunit11 +%if 0%{?fedora} || 0%{?rhel} >= 10 BuildRequires: phpunit12 %endif +%endif # Autoloader BuildRequires: php-fedora-autoloader-devel @@ -52,15 +63,20 @@ BuildRequires: php-fedora-autoloader-devel # "doctrine/instantiator": "^1.2 || ^2.0", # "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0", # "symfony/deprecation-contracts": "^2.5 || ^3.1" -Requires: php(language) >= 7.4 +Requires: php(language) >= 8.2 Requires: (php-composer(phpdocumentor/reflection-docblock) >= 5.2 with php-composer(phpdocumentor/reflection-docblock) < 6) Requires: (php-composer(sebastian/comparator) >= 3.0 with php-composer(sebastian/comparator) < 8) Requires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 8) +# remirepo:1 +%if 0 Requires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 3) +# remirepo:4 +%else +Requires: php-doctrine-instantiator >= 1.2 +Recommends: php-doctrine-instantiator2 +%endif # From phpcompatinfo report for version 1.11.0 -Requires: php-pcre -Requires: php-reflection -Requires: php-spl +# only pcre, reflection and spl # Autoloader Requires: php-composer(fedora/autoloader) @@ -83,11 +99,16 @@ to be used inside any testing framework out there with minimal effort. phpab --template fedora --output src/Prophecy/autoload.php src cat << 'EOF' | tee -a src/Prophecy/autoload.php -\Fedora\Autoloader\Dependencies::required([ - [ +if (PHP_VERSION_ID > 80400) { + $inst = [ '%{_datadir}/php/Doctrine/Instantiator2/autoload.php', '%{_datadir}/php/Doctrine/Instantiator/autoload.php', - ], + ]; +} else { + $inst = '%{_datadir}/php/Doctrine/Instantiator/autoload.php'; +} +\Fedora\Autoloader\Dependencies::required([ + $inst, '%{_datadir}/php/phpDocumentor/Reflection/DocBlock5/autoload.php', ]); if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec @@ -155,7 +176,7 @@ for cmd in php php82 php83 php84 php85; do || ret=1 fi done -# Not ready see https://github.com/phpspec/prophecy/issues/640 +if [ -x %{_bindir}/phpunit12 ]; then for cmd in php php83 php84 php85; do if which $cmd; then $cmd -d auto_prepend_file=vendor/autoload.php \ @@ -163,6 +184,7 @@ for cmd in php php83 php84 php85; do || ret=1 fi done +fi exit $ret %else : Test suite disabled @@ -177,6 +199,9 @@ exit $ret %changelog +* Mon Jan 12 2026 Remi Collet <remi@remirepo.net> - 1.24.0-2 +- use doctrine/instantiator v2 only with PHP 8.4+ + * Fri Nov 21 2025 Remi Collet <remi@remirepo.net> - 1.24.0-1 - update to 1.24.0 |
