summaryrefslogtreecommitdiffstats
path: root/php-sebastian-object-reflector.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-sebastian-object-reflector.spec')
-rw-r--r--php-sebastian-object-reflector.spec20
1 files changed, 14 insertions, 6 deletions
diff --git a/php-sebastian-object-reflector.spec b/php-sebastian-object-reflector.spec
index a2a5f91..3a70d19 100644
--- a/php-sebastian-object-reflector.spec
+++ b/php-sebastian-object-reflector.spec
@@ -1,6 +1,6 @@
# remirepo/fedora spec file for php-sebastian-object-reflector
#
-# Copyright (c) 2017 Remi Collet
+# Copyright (c) 2017-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -23,9 +23,11 @@
%global with_tests 0%{!?_without_tests:1}
%endif
+# NOTICE: used by phpunit 6, 7 and 8
+
Name: php-%{pk_vendor}-%{pk_project}%{major}
Version: 1.1.2
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Allows reflection of object attributes
License: BSD
@@ -38,7 +40,7 @@ BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
# from composer.json, "require-dev": {
# "phpunit/phpunit": "^6.0"
-BuildRequires: phpunit6
+BuildRequires: phpunit8
%endif
# from composer.json
@@ -65,7 +67,6 @@ and non-public ones.
%build
# Generate the Autoloader
%{_bindir}/phpab --template fedora --output src/autoload.php src
-sed -e 's:/usr/share/php/::' -i src/autoload.php
%install
@@ -81,12 +82,15 @@ cat << 'EOF' | tee -a vendor/autoload.php
require_once '%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php';
EOF
+: Fix for phpunit8
+find tests/ -name \*php -exec sed -e 's/setUp()/setUp():void/' -i {} \;
+
: Run upstream test suite
ret=0
for cmd in php php72 php73 php74 php80; do
if which $cmd; then
- %{_bindir}/php -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \
- %{_bindir}/phpunit6 --verbose || ret=1
+ %{_bindir}/php -d auto_prepend_file=%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php \
+ %{_bindir}/phpunit8 --verbose || ret=1
fi
done
exit $ret
@@ -96,6 +100,7 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md composer.json
@@ -104,6 +109,9 @@ exit $ret
%changelog
+* Wed Mar 10 2021 Remi Collet <remi@remirepo.net> - 1.1.2-3
+- switch to phpunit8
+
* Mon Nov 30 2020 Remi Collet <remi@remirepo.net> - 1.1.2-1
- update to 1.1.2 (no change)