diff options
-rw-r--r-- | composer.json | 16 | ||||
-rw-r--r-- | php-phpspec-prophecy-autoload.php | 13 | ||||
-rw-r--r-- | php-phpspec-prophecy.spec | 100 |
3 files changed, 70 insertions, 59 deletions
diff --git a/composer.json b/composer.json index 7151160..dbb2e55 100644 --- a/composer.json +++ b/composer.json @@ -18,16 +18,16 @@ ], "require": { - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "doctrine/instantiator": "^1.0.2", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "php": "^7.2", + "phpdocumentor/reflection-docblock": "^5.0", + "sebastian/comparator": "^3.0 || ^4.0", + "doctrine/instantiator": "^1.2", + "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0" }, "autoload": { @@ -44,7 +44,7 @@ "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.11.x-dev" } } } diff --git a/php-phpspec-prophecy-autoload.php b/php-phpspec-prophecy-autoload.php index f4b72b2..dfb7e08 100644 --- a/php-phpspec-prophecy-autoload.php +++ b/php-phpspec-prophecy-autoload.php @@ -11,12 +11,6 @@ require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; require_once 'Doctrine/Instantiator/autoload.php'; if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock5/autoload.php')) { require_once $dep; -} else if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock4/autoload.php')) { - require_once $dep; -} else if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock/autoload.php')) { - require_once $dep; -} else if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock2/autoload.php')) { - require_once $dep; } else { trigger_error('phpDocumentor reflection docblock autoloader not found in include path', E_USER_ERROR); exit(1); @@ -25,12 +19,9 @@ unset($dep); if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec require_once (stream_resolve_include_path('SebastianBergmann/Comparator4/autoload.php') ?: - (stream_resolve_include_path('SebastianBergmann/Comparator3/autoload.php') ?: - (stream_resolve_include_path('SebastianBergmann/Comparator2/autoload.php') ?: - 'SebastianBergmann/Comparator/autoload.php'))); + 'SebastianBergmann/Comparator3/autoload.php'); } if (!class_exists('SebastianBergmann\\RecursionContext\\Context')) { // v3 from phpunit, v2 from phpspec (via exporter) require_once (stream_resolve_include_path('SebastianBergmann/RecursionContext4/autoload.php') ?: - (stream_resolve_include_path('SebastianBergmann/RecursionContext3/autoload.php') ?: - 'SebastianBergmann/RecursionContext/autoload.php')); + 'SebastianBergmann/RecursionContext3/autoload.php'); } diff --git a/php-phpspec-prophecy.spec b/php-phpspec-prophecy.spec index 412b264..680fee5 100644 --- a/php-phpspec-prophecy.spec +++ b/php-phpspec-prophecy.spec @@ -7,19 +7,19 @@ # Please, preserve the changelog entries # %global bootstrap 0 -%global gh_commit 451c3cd1418cf640de218914901e51b064abb093 +%global gh_commit 8ff0384cd5d87e038297e79d85c99e4b2dcf0e61 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpspec %global gh_project prophecy %if %{bootstrap} # no test because of circular dependency with phpspec -%global with_tests 0%{?_with_tests:1} +%bcond_with tests %else -%global with_tests 0%{!?_without_tests:1} +%bcond_without tests %endif Name: php-phpspec-prophecy -Version: 1.10.3 +Version: 1.11.0 Release: 1%{?dist} Summary: Highly opinionated mocking framework for PHP @@ -32,43 +32,51 @@ Source2: makesrc.sh Source1: %{name}-autoload.php BuildArch: noarch -%if %{with_tests} +BuildRequires: php(language) >= 7.2 +%if %{with tests} +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(phpdocumentor/reflection-docblock) >= 5.0 with php-composer(phpdocumentor/reflection-docblock) < 6) +BuildRequires: (php-composer(sebastian/comparator) >= 3.0 with php-composer(sebastian/comparator) < 5) +BuildRequires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 5) +BuildRequires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 2) +# remirepo:6 +%else +BuildRequires: php-phpdocumentor-reflection-docblock5 +BuildRequires: php-sebastian-comparator3 +BuildRequires: php-sebastian-recursion-context3 +BuildRequires: php-doctrine-instantiator >= 1.2 +%endif # from composer.json, "require-dev": { -# "phpspec/phpspec": "^2.5|^3.2" -# "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" -BuildRequires: php-composer(phpspec/phpspec) >= 2.5 -# Autoloader -BuildRequires: php-composer(fedora/autoloader) +# "phpspec/phpspec": "^6.0" +# "phpunit/phpunit": "^8.0" +BuildRequires: php-composer(phpspec/phpspec) >= 6.0 +BuildRequires: phpunit8 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # from composer.json, "requires": { # "php": "^5.3|^7.0", -# "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", -# "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", -# "doctrine/instantiator": "^1.0.2", -# "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" -Requires: php(language) >= 5.3 +# "phpdocumentor/reflection-docblock": "^5.0", +# "sebastian/comparator": "^3.0|^4.0", +# "doctrine/instantiator": "^1.2", +# "sebastian/recursion-context": "^3.0|^4.0" +Requires: php(language) >= 7.2 +# remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(phpdocumentor/reflection-docblock) >= 2.0 with php-composer(phpdocumentor/reflection-docblock) < 6) -Requires: (php-composer(sebastian/comparator) >= 1.2.3 with php-composer(sebastian/comparator) < 5) -# recursion-context will be pulled by phpspec or phpunit or phpunit6 -#Requires: (php-composer(sebastian/recursion-context) >= 1.0 with php-composer(sebastian/recursion-context) < 4) -# use 1.0.4 to ensure we have the autoloader -Requires: (php-composer(doctrine/instantiator) >= 1.0.4 with php-composer(doctrine/instantiator) < 2) +Requires: (php-composer(phpdocumentor/reflection-docblock) >= 5.0 with php-composer(phpdocumentor/reflection-docblock) < 6) +Requires: (php-composer(sebastian/comparator) >= 3.0 with php-composer(sebastian/comparator) < 5) +Requires: (php-composer(sebastian/recursion-context) >= 3.0 with php-composer(sebastian/recursion-context) < 5) +Requires: (php-composer(doctrine/instantiator) >= 1.2 with php-composer(doctrine/instantiator) < 2) +# remirepo:4 %else -Requires: php-composer(phpdocumentor/reflection-docblock) >= 2.0 -# ignore v4 for now -Requires: php-composer(phpdocumentor/reflection-docblock) < 4 -Requires: php-composer(sebastian/comparator) >= 1.2.3 -Requires: php-composer(sebastian/comparator) < 3 -# recursion-context will be pulled by phpspec or phpunit or phpunit6 -#Requires: php-composer(sebastian/recursion-context) >= 1.0 -#Requires: php-composer(sebastian/recursion-context) < 4 -# use 1.0.4 to ensure we have the autoloader -Requires: php-composer(doctrine/instantiator) >= 1.0.4 -Requires: php-composer(doctrine/instantiator) < 2 +Requires: php-phpdocumentor-reflection-docblock5 +Requires: php-sebastian-comparator3 +Requires: php-sebastian-recursion-context3 +Requires: php-doctrine-instantiator >= 1.2 %endif -# From phpcompatinfo report for version 1.1.0 +# From phpcompatinfo report for version 1.11.0 Requires: php-pcre Requires: php-reflection Requires: php-spl @@ -102,23 +110,26 @@ cp -pr src/* %{buildroot}%{_datadir}/php %check -%if %{with_tests} +%if %{with tests} +: Dev autoloader +mkdir vendor +phpab --output vendor/autoload.php fixtures + : check autoloader php %{buildroot}%{_datadir}/php/Prophecy/autoload.php : check phpspec phpspec --version -VER=$(phpspec --version | sed -n -e 's/.* //;s/\..*$//;p') -if [ $VER -ge 4 ]; then - : phpspec $VER is too recent - exit 0 -fi ret=0 -for cmd in php php70 php71 php72 php73 php74; do +for cmd in php php72 php73 php74; do if which $cmd; then $cmd -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ + -d auto_prepend_file=vendor/autoload.php \ %{_bindir}/phpspec run --format pretty --verbose --no-ansi || ret=1 + + $cmd -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ + %{_bindir}/phpunit8 || ret=1 fi done exit $ret @@ -128,6 +139,7 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md @@ -136,6 +148,14 @@ exit $ret %changelog +* Wed Jul 8 2020 Remi Collet <remi@remirepo.net> - 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 <remi@remirepo.net> - 1.10.3-1 - update to 1.10.3 - allow phpdocumentor/reflection-docblock 5.0 |