Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Remi Collet
141368a8fc v1.13.0
(cherry picked from commit aef4e60548)
(cherry picked from commit 56fd71def4)
2021-03-18 06:57:25 +01:00
Remi Collet
64da380c1b update to 1.12.2
switch to phpunit9

(cherry picked from commit c039cfffdb)
2020-12-21 09:02:53 +01:00
Remi Collet
857fda030c v1.12..1
(cherry picked from commit ea3ddd8c66)
2020-09-29 14:52:47 +02:00
Remi Collet
fd61b2c8f6 switch to classmap autoloader
(cherry picked from commit 982f82b95c)
2020-09-28 16:56:26 +02:00
Remi Collet
1a886f7992 update to 1.12.0
raise dependency on phpdocumentor/reflection-docblock 5.2

(cherry picked from commit afabea3cf8)
2020-09-28 16:07:40 +02:00
4 changed files with 67 additions and 56 deletions

4
.gitignore vendored
View file

@ -22,3 +22,7 @@ clog
/php-phpspec-prophecy-1.10.3-451c3cd.tgz
/php-phpspec-prophecy-1.11.0-8ff0384.tgz
/php-phpspec-prophecy-1.11.1-b20034b.tgz
/php-phpspec-prophecy-1.12.0-765cd5d.tgz
/php-phpspec-prophecy-1.12.1-8ce8751.tgz
/php-phpspec-prophecy-1.12.2-245710e.tgz
/php-phpspec-prophecy-1.13.0-be1996e.tgz

View file

@ -1,27 +0,0 @@
<?php
/* Autoloader for phpspec/prophecy and its dependencies */
// Rely on include_path as in PHPUnit dependencies + circular dependencies
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Prophecy\\', __DIR__);
// Dependencies
require_once 'Doctrine/Instantiator/autoload.php';
if ($dep = stream_resolve_include_path('phpDocumentor/Reflection/DocBlock5/autoload.php')) {
require_once $dep;
} else {
trigger_error('phpDocumentor reflection docblock autoloader not found in include path', E_USER_ERROR);
exit(1);
}
unset($dep);
if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec
require_once (stream_resolve_include_path('SebastianBergmann/Comparator4/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') ?:
'SebastianBergmann/RecursionContext3/autoload.php');
}

View file

@ -1,25 +1,20 @@
# remirepo/fedora spec file for php-phpspec-prophecy
#
# Copyright (c) 2015-2019 Remi Collet
# Copyright (c) 2015-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global bootstrap 0
%global gh_commit b20034be5efcdab4fb60ca3a29cba2949aead160
%global gh_commit be1996ed8adc35c3fd795488a653f4b518be70ea
%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
%bcond_with tests
%else
%bcond_without tests
%endif
Name: php-phpspec-prophecy
Version: 1.11.1
Version: 1.13.0
Release: 1%{?dist}
Summary: Highly opinionated mocking framework for PHP
@ -28,33 +23,35 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{gh_short}.tgz
Source2: makesrc.sh
# Autoloader
Source1: %{name}-autoload.php
BuildArch: noarch
BuildRequires: php(language) >= 7.2
%if %{with tests}
BuildRequires: (php-composer(phpdocumentor/reflection-docblock) >= 5.0 with php-composer(phpdocumentor/reflection-docblock) < 6)
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) < 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)
# from composer.json, "require-dev": {
# "phpspec/phpspec": "^6.0"
# "phpunit/phpunit": "^8.0"
# "phpunit/phpunit": "^8.0 || ^9.0"
BuildRequires: php-composer(phpspec/phpspec) >= 6.0
BuildRequires: phpunit8
%if 0%{?fedora} >= 32 || 0%{?rhel} >=9
%global phpunit %{_bindir}/phpunit9
%else
%global phpunit %{_bindir}/phpunit8
%endif
BuildRequires: %{phpunit}
%endif
# Autoloader
BuildRequires: php-fedora-autoloader-devel
# from composer.json, "requires": {
# "php": "^5.3|^7.0",
# "phpdocumentor/reflection-docblock": "^5.0",
# "php": "^7.2 || ~8.0, <8.1",
# "phpdocumentor/reflection-docblock": "^5.2",
# "sebastian/comparator": "^3.0|^4.0",
# "doctrine/instantiator": "^1.2",
# "sebastian/recursion-context": "^3.0|^4.0"
Requires: php(language) >= 7.2
Requires: (php-composer(phpdocumentor/reflection-docblock) >= 5.0 with php-composer(phpdocumentor/reflection-docblock) < 6)
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) < 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)
@ -79,11 +76,32 @@ to be used inside any testing framework out there with minimal effort.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
cp %{SOURCE1} src/Prophecy/autoload.php
%build
# Nothing
phpab --template fedora --output src/Prophecy/autoload.php src
cat << 'EOF' | tee -a src/Prophecy/autoload.php
\Fedora\Autoloader\Dependencies::required([
'%{_datadir}/php/Doctrine/Instantiator/autoload.php',
'%{_datadir}/php/phpDocumentor/Reflection/DocBlock5/autoload.php',
]);
if (!class_exists('SebastianBergmann\\Comparator\\Comparator')) { // v2 from phpunit, v1 from phpspec
\Fedora\Autoloader\Dependencies::required([
[
'%{_datadir}/php/SebastianBergmann/Comparator4/autoload.php',
'%{_datadir}/php/SebastianBergmann/Comparator3/autoload.php',
],
]);
}
if (!class_exists('SebastianBergmann\\RecursionContext\\Context')) { // v2 from phpunit, v1 from phpspec
\Fedora\Autoloader\Dependencies::required([
[
'%{_datadir}/php/SebastianBergmann/RecursionContext4/autoload.php',
'%{_datadir}/php/SebastianBergmann/RecursionContext3/autoload.php',
],
]);
}
EOF
%install
@ -108,15 +126,14 @@ php %{buildroot}%{_datadir}/php/Prophecy/autoload.php
phpspec --version
ret=0
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 \
for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do
if which $cmdarg; then
set $cmdarg
$1 -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 \
-d auto_prepend_file=vendor/autoload.php \
%{_bindir}/phpunit8 || ret=1
$1 -d auto_prepend_file=vendor/autoload.php \
${2:-%{_bindir}/phpunit9}|| ret=1
fi
done
exit $ret
@ -133,6 +150,23 @@ exit $ret
%changelog
* Thu Mar 18 2021 Remi Collet <remi@remirepo.net> - 1.13.0-1
- update to 1.13.0
* Mon Dec 21 2020 Remi Collet <remi@remirepo.net> - 1.12.2-1
- update to 1.12.2
- switch to phpunit9
* Tue Sep 29 2020 Remi Collet <remi@remirepo.net> - 1.12.1-1
- update to 1.12.1
* Mon Sep 28 2020 Remi Collet <remi@remirepo.net> - 1.12.0-2
- switch to classmap autoloader
* Mon Sep 28 2020 Remi Collet <remi@remirepo.net> - 1.12.0-1
- update to 1.12.0
- raise dependency on phpdocumentor/reflection-docblock 5.2
* Wed Jul 8 2020 Remi Collet <remi@remirepo.net> - 1.11.1-1
- update to 1.11.1

View file

@ -1 +1 @@
SHA512 (php-phpspec-prophecy-1.11.1-b20034b.tgz) = 934ae0ae780651d31434118601610b6030b40a5d871a950601946fa4610273e9faf3dd955670fe79e7be86f6ab1636fe7ee08c51915455edb4322607cf4f87d9
SHA512 (php-phpspec-prophecy-1.13.0-be1996e.tgz) = 12b80dbfe9bdbe54935eb25ad039d698ac1538dd5a6c30a3799df1aa3c761bdfcf2d8e8091a7c88eb8233af403d62e082373b3bbec19951b1432e0305aa5f037