diff options
-rw-r--r-- | composer.json | 8 | ||||
-rw-r--r-- | php-mock2.spec | 45 |
2 files changed, 39 insertions, 14 deletions
diff --git a/composer.json b/composer.json index fd01774..f2d926e 100644 --- a/composer.json +++ b/composer.json @@ -24,17 +24,17 @@ }, "require": { "php": "^5.6 || ^7.0 || ^8.0", - "phpunit/php-text-template": "^1 || ^2 || ^3" + "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0", - "squizlabs/php_codesniffer": "^3.5" + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0 || ^11.0", + "squizlabs/php_codesniffer": "^3.8" }, "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 53c7490..05dbee1 100644 --- a/php-mock2.spec +++ b/php-mock2.spec @@ -1,20 +1,21 @@ # remirepo/fedora spec file for php-mock2 # -# Copyright (c) 2016-2023 Remi Collet +# Copyright (c) 2016-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%global gh_commit 6240b6f0a76d7b9d1ee4d70e686a7cc711619a9d +%global gh_commit fff1a621ebe54100fa3bd852e7be57773a0c0127 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_date 2024-02-10 %global gh_owner php-mock %global gh_project php-mock %global with_tests 0%{!?_without_tests:1} %global major 2 Name: php-mock%{major} -Version: 2.4.1 +Version: 2.5.0 Release: 1%{?dist} Summary: PHP-Mock can mock built-in PHP functions @@ -27,22 +28,23 @@ BuildArch: noarch BuildRequires: php(language) >= 7.4 %if %{with_tests} # from composer.json, "require-dev": { -# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0", +# "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0|| ^11.0", # "squizlabs/php_codesniffer": "^3.5" BuildRequires: phpunit8 BuildRequires: phpunit9 -# TODO phpunit10 but requires php 8.1 +BuildRequires: phpunit10 +# TODO phpunit11 but requires php 8.2 %endif # For autoloader BuildRequires: php-composer(fedora/autoloader) # from composer.json, "require": { # "php": "^5.6 || ^7.0 || ^8.0", -# "phpunit/php-text-template": "^1 || ^2 || ^3") +# "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4") 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) < 4) +Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 5) # remirepo:3 %else Requires: php-phpunit-Text-Template @@ -89,12 +91,22 @@ 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([ - [ +if (PHP_VERSION_ID >= 80200) { + $deps = [ + '%{_datadir}/php/SebastianBergmann/Template4/autoload.php', + '%{_datadir}/php/SebastianBergmann/Template3/autoload.php', + '%{_datadir}/php/SebastianBergmann/Template2/autoload.php', + '%{_datadir}/php/Text/Template/Autoload.php', + ]; +} else { + $deps = [ '%{_datadir}/php/SebastianBergmann/Template3/autoload.php', '%{_datadir}/php/SebastianBergmann/Template2/autoload.php', '%{_datadir}/php/Text/Template/Autoload.php', - ] + ]; +} +\Fedora\Autoloader\Dependencies::required([ + $deps, ]); AUTOLOAD grep -v '<?php' autoload.php >>rpm/php/phpmock%{major}/autoload.php @@ -152,6 +164,16 @@ if [ -x %{_bindir}/phpunit10 ]; then fi done fi + +if [ -x %{_bindir}/phpunit11 ]; then + for cmd in php php82 php83;do + if which $cmd; then + $cmd %{_bindir}/phpunit11 \ + --filter '^((?!(testDefiningAfterCallingUnqualified|testEnable)).)*$' \ + --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php rpm/tests || ret=1 + fi + done +fi exit $ret %else : bootstrap build with test suite disabled @@ -169,6 +191,9 @@ exit $ret %changelog +* Mon Feb 12 2024 Remi Collet <remi@remirepo.net> - 2.5.0-1 +- update to 2.5.0 + * Tue Jun 13 2023 Remi Collet <remi@remirepo.net> - 2.4.1-1 - update to 2.4.1 (no change) |