summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json10
-rw-r--r--php-mock-integration2.spec42
2 files changed, 33 insertions, 19 deletions
diff --git a/composer.json b/composer.json
index cf1a32c..2ee9669 100644
--- a/composer.json
+++ b/composer.json
@@ -16,13 +16,17 @@
"autoload": {
"psr-4": {"phpmock\\integration\\": "classes/"}
},
+ "autoload-dev": {
+ "files": ["tests/autoload.php"],
+ "psr-4": {"phpmock\\integration\\": "tests/"}
+ },
"require": {
"php": ">=5.6",
- "php-mock/php-mock": "^2",
- "phpunit/php-text-template": "^1"
+ "php-mock/php-mock": "^2.2",
+ "phpunit/php-text-template": "^1 || ^2"
},
"require-dev": {
- "phpunit/phpunit": "^4|^5"
+ "phpunit/phpunit": "^5.7.27 || ^6 || ^7 || ^8 || ^9"
},
"archive": {
"exclude": ["/tests"]
diff --git a/php-mock-integration2.spec b/php-mock-integration2.spec
index 879c7f1..e9621e0 100644
--- a/php-mock-integration2.spec
+++ b/php-mock-integration2.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 5a0d7d7755f823bc2a230cfa45058b40f9013bc4
+%global gh_commit 003d585841e435958a02e9b986953907b8b7609b
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner php-mock
%global gh_project php-mock-integration
@@ -14,8 +14,8 @@
%global major 2
Name: php-mock-integration%{major}
-Version: 2.0.0
-Release: 5%{?dist}
+Version: 2.1.0
+Release: 1%{?dist}
Summary: Integration package for PHP-Mock
License: WTFPL
@@ -26,30 +26,32 @@ BuildArch: noarch
BuildRequires: php(language) >= 5.6
%if %{with_tests}
# from composer.json, "require-dev": {
-# "phpunit/phpunit": "^4|^5"
+# "phpunit/phpunit": "^5.7.27 || ^6 || ^7 || ^8 || ^9"
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(php-mock/php-mock) >= 2.1 with php-composer(php-mock/php-mock) < 3)
-BuildRequires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 2)
-# remirepo:4
+BuildRequires: (php-composer(php-mock/php-mock) >= 2.2 with php-composer(php-mock/php-mock) < 3)
+BuildRequires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 3)
+%global phpunit %{_bindir}/phpunit8
+# remirepo:5
%else
BuildRequires: php-mock2
BuildRequires: php-phpunit-Text-Template
+%global phpunit %{_bindir}/phpunit
%endif
-BuildRequires: php-phpunit-PHPUnit
+BuildRequires: %{phpunit}
# For autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# from composer.json, "require": {
# "php": ">=5.6",
-# "php-mock/php-mock": "^2",
-# "phpunit/php-text-template": "^1"
+# "php-mock/php-mock": "^2.2",
+# "phpunit/php-text-template": "^1 || ^2"
Requires: php(language) >= 5.6
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(php-mock/php-mock) >= 2 with php-composer(php-mock/php-mock) < 3)
-Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 2)
+Requires: (php-composer(php-mock/php-mock) >= 2.2 with php-composer(php-mock/php-mock) < 3)
+Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 3)
# remirepo:4
%else
Requires: php-mock2
@@ -87,14 +89,17 @@ mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
-require_once '%{_datadir}/php/phpmock%{major}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', '%{buildroot}%{_datadir}/php/phpmock%{major}');
+\Fedora\Autoloader\Autoload::addPsr4('phpmock\\integration\\', dirname(__DIR__) . '/tests');
+require_once '%{_datadir}/php/phpmock%{major}/autoload.php';
+require_once dirname(__DIR__) . '/tests/autoload.php';
EOF
ret=0
-for cmd in php php70 php71 php72 php73; do
- if which $cmd; then
- %{_bindir}/phpunit --verbose || ret=1
+for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit7" "php73 %{_bindir}/phpunit8" "php74 %{_bindir}/phpunit9"; do
+ if which $cmdarg; then
+ set $cmdarg
+ $1 $2 --verbose || ret=1
fi
done
exit $ret
@@ -104,6 +109,7 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -112,6 +118,10 @@ exit $ret
%changelog
+* Mon Feb 10 2020 Remi Collet <remi@remirepo.net> - 2.1.0-1
+- update to 2.1.0
+- raise dependency on php-mock 2.2
+
* Thu Mar 7 2019 Remi Collet <remi@remirepo.net> - 2.0.0-5
- use php-mock2 2.1 single autoloader