1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
|
# 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 <remi@remirepo.net> - 1.20.0-1
- update to 1.20.0
* Thu Feb 29 2024 Remi Collet <remi@remirepo.net> - 1.19.0-1
- update to 1.19.0
- allow doctrine/instantiator 6
- allow sebastian/recursion-context 6
* Fri Dec 8 2023 Remi Collet <remi@remirepo.net> - 1.18.0-1
- update to 1.18.0
- run test suite with phpunit8, phpunit9 and phpunit10
* Wed Sep 27 2023 Remi Collet <remi@remirepo.net> - 1.17.0-4
- disable phpspec tests
* Fri Feb 3 2023 Remi Collet <remi@remirepo.net> - 1.17.0-2
- fix autoloader
* Fri Feb 3 2023 Remi Collet <remi@remirepo.net> - 1.17.0-1
- update to 1.17.0
- allow doctrine/instantiator v2
* Thu Dec 1 2022 Remi Collet <remi@remirepo.net> - 1.16.0-1
- update to 1.16.0
* Wed Dec 8 2021 Remi Collet <remi@remirepo.net> - 1.15.0-1
- update to 1.15.0
* Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 1.14.0-1
- update to 1.14.0
* 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
* 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
* Tue Jan 21 2020 Remi Collet <remi@remirepo.net> - 1.10.2-1
- update to 1.10.2
- allow sebastian/comparator 4 and sebastian/recursion-context 4
* Fri Jan 3 2020 Remi Collet <remi@remirepo.net> - 1.10.1-1
- update to 1.10.1
* Thu Dec 19 2019 Remi Collet <remi@remirepo.net> - 1.10.0-1
- update to 1.10.0
- raise dependency on sebastian/comparator 1.2.3
* Fri Oct 4 2019 Remi Collet <remi@remirepo.net> - 1.9.0-1
- update to 1.9.0
* Thu Jun 13 2019 Remi Collet <remi@remirepo.net> - 1.8.1-1
- update to 1.8.1
* Thu Dec 6 2018 Remi Collet <remi@remirepo.net> - 1.8.0-2
- cleanup for EL-8
* Mon Aug 20 2018 Remi Collet <remi@remirepo.net> - 1.8.0-1
- update to 1.8.0
* Thu Apr 19 2018 Remi Collet <remi@remirepo.net> - 1.7.6-1
- update to 1.7.6
* Tue Feb 20 2018 Remi Collet <remi@remirepo.net> - 1.7.5-1
- Update to 1.7.5
* Mon Feb 12 2018 Remi Collet <remi@remirepo.net> - 1.7.4-1
- Update to 1.7.4
- use range dependency on F27+
* Mon Nov 27 2017 Remi Collet <remi@remirepo.net> - 1.7.3-1
- Update to 1.7.3
* Tue Sep 5 2017 Remi Collet <remi@remirepo.net> - 1.7.2-1
- Update to 1.7.2
* Mon Sep 4 2017 Remi Collet <remi@remirepo.net> - 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 <shawn@iwin.ski> - 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 <remi@remirepo.net> - 1.7.0-3
- drop implicit dependency on sebastian/recursion-context
* Fri Mar 3 2017 Remi Collet <remi@remirepo.net> - 1.7.0-2
- fix autoloader for dep. with multiple versions
* Fri Mar 3 2017 Remi Collet <remi@remirepo.net> - 1.7.0-1
- Update to 1.7.0
* Tue Nov 22 2016 Remi Collet <remi@fedoraproject.org> - 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 <remi@fedoraproject.org> - 1.6.1-1
- update to 1.6.1
* Mon Feb 15 2016 Remi Collet <remi@fedoraproject.org> - 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 <remi@fedoraproject.org> - 1.5.0-2
- fix autolaoder, rely on include_path for symfony/class-loader
* Thu Aug 13 2015 Remi Collet <remi@fedoraproject.org> - 1.5.0-1
- update to 1.5.0
* Mon Jun 29 2015 Remi Collet <remi@fedoraproject.org> - 1.4.1-4
- use symfony/class-loader
- enable test suite
* Tue Apr 28 2015 Remi Collet <remi@fedoraproject.org> - 1.4.1-1
- update to 1.4.1
* Sun Mar 29 2015 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
- update to 1.4.0
- add dependency on sebastian/comparator
* Fri Feb 13 2015 Remi Collet <remi@fedoraproject.org> - 1.3.1-1
- initial package
|