# remirepo/fedora spec file for php-phpspec-prophecy # # Copyright (c) 2015-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global gh_commit a0165c648cab6a80311c74ffc708a07bb53ecc93 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpspec %global gh_project prophecy %bcond_without tests %bcond_with phpspec Name: php-phpspec-prophecy Version: 1.20.0 Release: 1%{?dist} Summary: Highly opinionated mocking framework for PHP License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{name}-%{version}-%{gh_short}.tgz Source2: makesrc.sh BuildArch: noarch BuildRequires: php(language) >= 7.2 %if %{with tests} 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) < 7) BuildRequires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 7) BuildRequires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 3) # from composer.json, "require-dev": { # "friendsofphp/php-cs-fixer": "^3.40", # "phpspec/phpspec": "^6.0 || ^7.0" # "phpstan/phpstan": "^1.9", # "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" %if %{with phpspec} BuildRequires: php-composer(phpspec/phpspec) >= 6.0 %endif BuildRequires: phpunit8 BuildRequires: phpunit9 BuildRequires: phpunit10 # remirepo:3 %if 0%{?fedora} >= 38 || 0%{?rhel} >= 10 BuildRequires: phpunit11 %endif %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # from composer.json, "requires": { # "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", # "phpdocumentor/reflection-docblock": "^5.2", # "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", # "doctrine/instantiator": "^1.2 || ^2.0", # "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" Requires: php(language) >= 7.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) < 7) Requires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 7) Requires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 3) # From phpcompatinfo report for version 1.11.0 Requires: php-pcre Requires: php-reflection Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) Provides: php-composer(phpspec/prophecy) = %{version} %description Prophecy is a highly opinionated yet very powerful and flexible PHP object mocking framework. Though initially it was created to fulfil phpspec2 needs, it is flexible enough to be used inside any testing framework out there with minimal effort. %prep %setup -q -n %{gh_project}-%{gh_commit} %build phpab --template fedora --output src/Prophecy/autoload.php src cat << 'EOF' | tee -a src/Prophecy/autoload.php $inst = ['%{_datadir}/php/Doctrine/Instantiator/autoload.php']; if (PHP_VERSION_ID > 80100) { array_unshift($inst, '%{_datadir}/php/Doctrine/Instantiator2/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 $inst = [ '%{_datadir}/php/SebastianBergmann/Comparator4/autoload.php', '%{_datadir}/php/SebastianBergmann/Comparator3/autoload.php', ]; if (PHP_VERSION_ID > 80100) { array_unshift($inst, '%{_datadir}/php/SebastianBergmann/Comparator5/autoload.php'); } if (PHP_VERSION_ID > 80200) { array_unshift($inst, '%{_datadir}/php/SebastianBergmann/Comparator6/autoload.php'); } \Fedora\Autoloader\Dependencies::required([$inst]); } if (!class_exists('SebastianBergmann\\RecursionContext\\Context')) { // v2 from phpunit, v1 from phpspec $inst = [ '%{_datadir}/php/SebastianBergmann/RecursionContext4/autoload.php', '%{_datadir}/php/SebastianBergmann/RecursionContext3/autoload.php', ]; if (PHP_VERSION_ID > 80100) { array_unshift($inst, '%{_datadir}/php/SebastianBergmann/RecursionContext5/autoload.php'); } if (PHP_VERSION_ID > 80200) { array_unshift($inst, '%{_datadir}/php/SebastianBergmann/RecursionContext6/autoload.php'); } \Fedora\Autoloader\Dependencies::required([$inst]); } EOF %install mkdir -p %{buildroot}%{_datadir}/php cp -pr src/* %{buildroot}%{_datadir}/php %check %if %{with tests} : Dev autoloader mkdir vendor phpab --output vendor/autoload.php fixtures tests cat << 'EOF' | tee -a vendor/autoload.php require_once '%{buildroot}%{_datadir}/php/Prophecy/autoload.php'; EOF : check autoloader php %{buildroot}%{_datadir}/php/Prophecy/autoload.php %if %{with phpspec} : check phpspec phpspec --version %endif ret=0 # ignore it_can_not_double_an_enum on all version. Not ready for cmd in php php81 php82 php83 php84; do if which $cmd; then %if %{with phpspec} $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpspec run --format pretty --verbose --no-ansi || ret=1 %endif $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpunit8 \ || ret=1 $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpunit9 \ || ret=1 $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpunit10 \ || ret=1 fi done # remirepo:9 %if 0%{?fedora} >= 38 || 0%{?rhel} >= 10 for cmd in php php82 php83 php84; do if which $cmd; then $cmd -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpunit11 \ || ret=1 fi done %endif exit $ret %else : Test suite disabled %endif %files %license LICENSE %doc *.md %doc composer.json %{_datadir}/php/Prophecy %changelog * Thu Nov 21 2024 Remi Collet - 1.20.0-1 - update to 1.20.0 * Thu Feb 29 2024 Remi Collet - 1.19.0-1 - update to 1.19.0 - allow doctrine/instantiator 6 - allow sebastian/recursion-context 6 * Fri Dec 8 2023 Remi Collet - 1.18.0-1 - update to 1.18.0 - run test suite with phpunit8, phpunit9 and phpunit10 * Wed Sep 27 2023 Remi Collet - 1.17.0-4 - disable phpspec tests * Fri Feb 3 2023 Remi Collet - 1.17.0-2 - fix autoloader * Fri Feb 3 2023 Remi Collet - 1.17.0-1 - update to 1.17.0 - allow doctrine/instantiator v2 * Thu Dec 1 2022 Remi Collet - 1.16.0-1 - update to 1.16.0 * Wed Dec 8 2021 Remi Collet - 1.15.0-1 - update to 1.15.0 * Fri Sep 10 2021 Remi Collet - 1.14.0-1 - update to 1.14.0 * Thu Mar 18 2021 Remi Collet - 1.13.0-1 - update to 1.13.0 * Mon Dec 21 2020 Remi Collet - 1.12.2-1 - update to 1.12.2 - switch to phpunit9 * Tue Sep 29 2020 Remi Collet - 1.12.1-1 - update to 1.12.1 * Mon Sep 28 2020 Remi Collet - 1.12.0-2 - switch to classmap autoloader * Mon Sep 28 2020 Remi Collet - 1.12.0-1 - update to 1.12.0 - raise dependency on phpdocumentor/reflection-docblock 5.2 * Wed Jul 8 2020 Remi Collet - 1.11.1-1 - update to 1.11.1 * Wed Jul 8 2020 Remi Collet - 1.11.0-1 - update to 1.11.0 - raise dependency on PHP 7.2 - raise dependency on phpdocumentor/reflection-docblock 5.0 - raise dependency on sebastian/comparator 3.0 - raise dependency on doctrine/instantiator 1.2 - raise dependency on sebastian/recursion-context 3.0 * Fri Mar 6 2020 Remi Collet - 1.10.3-1 - update to 1.10.3 - allow phpdocumentor/reflection-docblock 5.0 * Tue Jan 21 2020 Remi Collet - 1.10.2-1 - update to 1.10.2 - allow sebastian/comparator 4 and sebastian/recursion-context 4 * Fri Jan 3 2020 Remi Collet - 1.10.1-1 - update to 1.10.1 * Thu Dec 19 2019 Remi Collet - 1.10.0-1 - update to 1.10.0 - raise dependency on sebastian/comparator 1.2.3 * Fri Oct 4 2019 Remi Collet - 1.9.0-1 - update to 1.9.0 * Thu Jun 13 2019 Remi Collet - 1.8.1-1 - update to 1.8.1 * Thu Dec 6 2018 Remi Collet - 1.8.0-2 - cleanup for EL-8 * Mon Aug 20 2018 Remi Collet - 1.8.0-1 - update to 1.8.0 * Thu Apr 19 2018 Remi Collet - 1.7.6-1 - update to 1.7.6 * Tue Feb 20 2018 Remi Collet - 1.7.5-1 - Update to 1.7.5 * Mon Feb 12 2018 Remi Collet - 1.7.4-1 - Update to 1.7.4 - use range dependency on F27+ * Mon Nov 27 2017 Remi Collet - 1.7.3-1 - Update to 1.7.3 * Tue Sep 5 2017 Remi Collet - 1.7.2-1 - Update to 1.7.2 * Mon Sep 4 2017 Remi Collet - 1.7.1-1 - Update to 1.7.1 - use git snapshot for sources - skip test with phpspec v4 * Thu Apr 13 2017 Shawn Iwinski - 1.7.0-4 - Prepare for php-phpdocumentor-reflection-docblock => php-phpdocumentor-reflection-docblock2 dependency rename - Update autoloader to try loading newest php-composer(phpdocumentor/reflection-docblock), then try loading older v2, then trigger an error if neither are found in include path * Sat Mar 4 2017 Remi Collet - 1.7.0-3 - drop implicit dependency on sebastian/recursion-context * Fri Mar 3 2017 Remi Collet - 1.7.0-2 - fix autoloader for dep. with multiple versions * Fri Mar 3 2017 Remi Collet - 1.7.0-1 - Update to 1.7.0 * Tue Nov 22 2016 Remi Collet - 1.6.2-1 - update to 1.6.2 - allow sebastian/recursion-context 2.0 - switch to fedora/autoloader * Tue Jun 7 2016 Remi Collet - 1.6.1-1 - update to 1.6.1 * Mon Feb 15 2016 Remi Collet - 1.6.0-1 - update to 1.6.0 - add dependency on sebastian/recursion-context - run test suite with both PHP 5 and 7 when available - ignore 1 failed spec with PHP 7 open https://github.com/phpspec/prophecy/issues/258 * Wed Oct 28 2015 Remi Collet - 1.5.0-2 - fix autolaoder, rely on include_path for symfony/class-loader * Thu Aug 13 2015 Remi Collet - 1.5.0-1 - update to 1.5.0 * Mon Jun 29 2015 Remi Collet - 1.4.1-4 - use symfony/class-loader - enable test suite * Tue Apr 28 2015 Remi Collet - 1.4.1-1 - update to 1.4.1 * Sun Mar 29 2015 Remi Collet - 1.4.0-1 - update to 1.4.0 - add dependency on sebastian/comparator * Fri Feb 13 2015 Remi Collet - 1.3.1-1 - initial package