summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json7
-rw-r--r--php-mock2.spec33
2 files changed, 25 insertions, 15 deletions
diff --git a/composer.json b/composer.json
index 44e876b..3d34f6b 100644
--- a/composer.json
+++ b/composer.json
@@ -16,14 +16,15 @@
"autoload": {
"psr-4": {
"phpmock\\": ["classes/", "tests/"]
- }
+ },
+ "files": ["autoload.php"]
},
"require": {
- "php": ">=5.6",
+ "php": "^5.6 || ^7.0",
"phpunit/php-text-template": "^1"
},
"require-dev": {
- "phpunit/phpunit": "^5.7"
+ "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0"
},
"replace": {
"malkusch/php-mock": "*"
diff --git a/php-mock2.spec b/php-mock2.spec
index 4970a72..e8446fa 100644
--- a/php-mock2.spec
+++ b/php-mock2.spec
@@ -1,12 +1,12 @@
# remirepo/fedora spec file for php-mock2
#
-# Copyright (c) 2016-2018 Remi Collet
+# Copyright (c) 2016-2019 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit 22d297231118e6fd5b9db087fbe1ef866c2b95d2
+%global gh_commit 611ccd15f53d70b4d1fd31e886f7a5c08dc53bbb
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner php-mock
%global gh_project php-mock
@@ -14,8 +14,8 @@
%global major 2
Name: php-mock%{major}
-Version: 2.0.0
-Release: 2%{?dist}
+Version: 2.1.0
+Release: 1%{?dist}
Summary: PHP-Mock can mock built-in PHP functions
License: WTFPL
@@ -26,21 +26,24 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.6
%if %{with_tests}
# from composer.json, "require-dev": {
-# "phpunit/phpunit": "^5.7"
+# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0"
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 2)
-# remirepo:3
+BuildRequires: phpunit7
+%global phpunit %{_bindir}/phpunit7
+# remirepo:5
%else
BuildRequires: php-phpunit-Text-Template
-%endif
BuildRequires: php-phpunit-PHPUnit >= 5.7
+%global phpunit %{_bindir}/phpunit
+%endif
%endif
# For autoloader
BuildRequires: php-composer(fedora/autoloader)
# from composer.json, "require": {
-# "php": ">=5.6",
+# "php": "^5.6 || ^7.0",
# "phpunit/php-text-template": "^1"
Requires: php(language) >= 5.6
# remirepo:1
@@ -94,10 +97,12 @@ cat << 'AUTOLOAD' | tee tests/autoload.php
<?php
/* Autoloader for %{name} tests */
-require_once '%{_datadir}/php/phpmock%{major}/autoload.php';
+require_once dirname(dirname(__DIR__)) . '/php/phpmock%{major}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', __DIR__);
AUTOLOAD
+grep -v '<?php' autoload.php >>tests/autoload.php
+
%build
# Nothing
@@ -117,9 +122,10 @@ cp -pr tests %{buildroot}%{_datadir}/tests/phpmock%{major}
%if %{with_tests}
# TODO: local build fails, build in mock is ok
ret=0
-for cmd in php php70 php71 php72; do
- if which $cmd; then
- $cmd %{_bindir}/phpunit --bootstrap %{buildroot}%{_datadir}/php/phpmock2/autoload.php --verbose || ret=1
+for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit6" "php71 %{_bindir}/phpunit7" "php72 %{_bindir}/phpunit8" "php73 %{_bindir}/phpunit8"; do
+ if which $cmdarg; then
+ set $cmdarg
+ $1 $2 --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose || ret=1
fi
done
exit $ret
@@ -138,6 +144,9 @@ exit $ret
%changelog
+* Wed Mar 6 2019 Remi Collet <remi@remirepo.net> - 2.1.0-1
+- update to 2.1.0
+
* Fri Mar 23 2018 Remi Collet <remi@remirepo.net> - 2.0.0-2
- use range dependencies on F27+