diff options
author | Remi Collet <remi@remirepo.net> | 2020-02-10 09:40:06 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-02-10 09:40:06 +0100 |
commit | 6f1d9e59b57b768900aa51fe051b4a581b1fe6d2 (patch) | |
tree | 66a655671d459186f28a31c5f1c635b9c325190c | |
parent | ceb88eabcbda3c62be989713ab10ffad3a5fef6d (diff) |
update to 2.2.1
allow phpunit9 and phpunit/php-text-template v2
-rw-r--r-- | composer.json | 9 | ||||
-rw-r--r-- | php-mock2.spec | 39 |
2 files changed, 28 insertions, 20 deletions
diff --git a/composer.json b/composer.json index 5500e4e..89a2e59 100644 --- a/composer.json +++ b/composer.json @@ -14,25 +14,26 @@ } ], "autoload": { + "files": ["autoload.php"], "psr-4": { "phpmock\\": ["classes/", "tests/"] } }, "autoload-dev": { - "files": ["autoload.php"] + "files": ["tests/autoload.php"] }, "require": { "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1" + "phpunit/php-text-template": "^1 || ^2" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0" + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0" }, "replace": { "malkusch/php-mock": "*" }, "suggest": { - "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." + "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." }, "archive": { "exclude": ["/tests"] diff --git a/php-mock2.spec b/php-mock2.spec index fd20d39..5c6e16f 100644 --- a/php-mock2.spec +++ b/php-mock2.spec @@ -1,12 +1,12 @@ # remirepo/fedora spec file for php-mock2 # -# Copyright (c) 2016-2019 Remi Collet +# Copyright (c) 2016-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%global gh_commit 35379d7b382b787215617f124662d9ead72c15e3 +%global gh_commit 8ca7205ad5e73fbbffa9bde9f6bc90daf5e49702 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner php-mock %global gh_project php-mock @@ -14,7 +14,7 @@ %global major 2 Name: php-mock%{major} -Version: 2.1.2 +Version: 2.2.1 Release: 1%{?dist} Summary: PHP-Mock can mock built-in PHP functions @@ -26,12 +26,12 @@ BuildArch: noarch BuildRequires: php(language) >= 5.6 %if %{with_tests} # from composer.json, "require-dev": { -# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0" +# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.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) -BuildRequires: phpunit7 -%global phpunit %{_bindir}/phpunit7 +BuildRequires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 3) +BuildRequires: phpunit8 +%global phpunit %{_bindir}/phpunit8 # remirepo:5 %else BuildRequires: php-phpunit-Text-Template @@ -48,7 +48,7 @@ BuildRequires: php-composer(fedora/autoloader) Requires: php(language) >= 5.6 # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 2) +Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 3) # remirepo:3 %else Requires: php-phpunit-Text-Template @@ -82,6 +82,7 @@ Autoloader: %{_datadir}/php/phpmock%{major}/autoload.php %setup -q -n %{gh_project}-%{gh_commit} : Prepare the layout +mv tests/autoload.php testload.php mkdir -p rpm/tests rpm/php mv classes rpm/php/phpmock%{major} mv tests rpm/tests/phpmock%{major} @@ -94,11 +95,15 @@ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('phpmock\\', __DIR__); \Fedora\Autoloader\Autoload::addPsr4('phpmock\\', dirname(dirname(__DIR__)) . '/tests/phpmock%{major}'); -\Fedora\Autoloader\Dependencies::required(array( - '%{_datadir}/php/Text/Template/Autoload.php', -)); +\Fedora\Autoloader\Dependencies::required([ + [ + '%{_datadir}/php/SebastianBergmann/Template2/autoload.php', + '%{_datadir}/php/Text/Template/Autoload.php', + ] +]); AUTOLOAD grep -v '<?php' autoload.php >>rpm/php/phpmock%{major}/autoload.php +grep -v '<?php' testload.php >>rpm/php/phpmock%{major}/autoload.php ln -s ../../php/phpmock%{major}/autoload.php rpm/tests/phpmock%{major}/autoload.php @@ -120,14 +125,11 @@ cp -pr rpm/tests %{buildroot}%{_datadir}/tests %check %if %{with_tests} -# TODO: local build fails, build in mock is ok -# TODO: php 7.4: There was 1 failure: -# see https://github.com/php-mock/php-mock/issues/28 ret=0 -for cmdarg in "php %{phpunit}" "php71 %{_bindir}/phpunit7" "php72 %{_bindir}/phpunit8" "php73 %{_bindir}/phpunit8"; do +for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" "php73 %{_bindir}/phpunit8" "php74 %{_bindir}/phpunit9"; do if which $cmdarg; then set $cmdarg - $1 $2 --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose rpm/tests|| ret=1 + $1 $2 --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose rpm/tests || ret=1 fi done exit $ret @@ -137,6 +139,7 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE %doc composer.json @@ -146,6 +149,10 @@ exit $ret %changelog +* Mon Feb 10 2020 Remi Collet <remi@remirepo.net> - 2.2.1-1 +- update to 2.2.1 +- allow phpunit9 and phpunit/php-text-template v2 + * Thu Jun 6 2019 Remi Collet <remi@remirepo.net> - 2.1.2-1 - update to 2.1.2 |