summaryrefslogtreecommitdiffstats
path: root/php-mock-phpunit/php-mock-phpunit.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-05-11 07:29:07 +0200
committerRemi Collet <remi@remirepo.net>2017-05-11 07:29:07 +0200
commit1fd4a038b3ffb546cbd395b7ccea918875dbe605 (patch)
tree2b375a44cac682bd05dd495c15bac63090dc3692 /php-mock-phpunit/php-mock-phpunit.spec
parent7360e1427a7917692cc64c6dd1a7159fbf281d6f (diff)
switch to fedora/autoloaderHEADmaster
Diffstat (limited to 'php-mock-phpunit/php-mock-phpunit.spec')
-rw-r--r--php-mock-phpunit/php-mock-phpunit.spec30
1 files changed, 16 insertions, 14 deletions
diff --git a/php-mock-phpunit/php-mock-phpunit.spec b/php-mock-phpunit/php-mock-phpunit.spec
index 3eb6824..af998fc 100644
--- a/php-mock-phpunit/php-mock-phpunit.spec
+++ b/php-mock-phpunit/php-mock-phpunit.spec
@@ -14,7 +14,7 @@
Name: php-mock-phpunit
Version: 1.1.2
-Release: 1%{?dist}
+Release: 3%{?dist}
Summary: Mock built-in PHP functions with PHPUnit.
Group: Development/Libraries
@@ -22,12 +22,14 @@ License: WTFPL
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.5
%if %{with_tests}
+BuildRequires: php-composer(php-mock/php-mock-integration) < 2
BuildRequires: php-composer(php-mock/php-mock-integration) >= 1
BuildRequires: php-composer(phpunit/phpunit) > 4
+# For autoloader
+BuildRequires: php-composer(fedora/autoloader)
%endif
# from composer.json, "require": {
@@ -64,7 +66,6 @@ No further extension is needed.
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}/php/
mkdir -p %{buildroot}%{_datadir}/php/phpmock
cp -pr classes %{buildroot}%{_datadir}/php/phpmock/phpunit
@@ -75,26 +76,24 @@ cp -pr classes %{buildroot}%{_datadir}/php/phpmock/phpunit
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
require_once '%{_datadir}/tests/phpmock/autoload.php';
-$fedoraClassLoader->addPrefix('phpmock\\', '%{buildroot}%{_datadir}/php');
+\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', '%{buildroot}%{_datadir}/php/phpmock');
EOF
-%{_bindir}/phpunit
-
-if which php71; then
- php71 %{_bindir}/phpunit
-fi
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ %{_bindir}/phpunit --verbose || ret=1
+ fi
+done
+exit $ret
%else
: bootstrap build with test suite disabled
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -103,6 +102,9 @@ rm -rf %{buildroot}
%changelog
+* Thu May 11 2017 Remi Collet <remi@remirepo.net> - 1.1.2-3
+- switch to fedora/autoloader
+
* Thu Jun 16 2016 Remi Collet <remi@fedoraproject.org> - 1.1.2-1
- update to 1.1.2 (no change)