From a3c92aad0043e07ded5a1fc1e493d29cb5e17524 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 14 Apr 2021 12:17:01 +0200 Subject: update to 2.6.0 switch to phpunit7 --- composer.json | 10 ++++----- php-mtdowling-jmespath-php.spec | 47 ++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 8ae5bb0..27d5d5d 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ ], "require": { - "php": ">=5.4.0", - "symfony/polyfill-mbstring": "^1.4" + "php": "^5.4 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" }, "require-dev": { - "composer/xdebug-handler": "^1.2", - "phpunit/phpunit": "^4.8.36|^7.5.15" + "composer/xdebug-handler": "^1.4", + "phpunit/phpunit": "^4.8.36 || ^7.5.15" }, "autoload": { @@ -33,7 +33,7 @@ "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.6-dev" } } } diff --git a/php-mtdowling-jmespath-php.spec b/php-mtdowling-jmespath-php.spec index 789671a..392d390 100644 --- a/php-mtdowling-jmespath-php.spec +++ b/php-mtdowling-jmespath-php.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-mtdowling-jmespath-php # -# Copyright (c) 2015-2020 Shawn Iwinski +# Copyright (c) 2015-2021 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -10,19 +10,18 @@ # Please preserve changelog entries # +%bcond_without tests + %global github_owner jmespath %global github_name jmespath.php -%global github_version 2.5.0 -%global github_commit 52168cb9472de06979613d365c7f1ab8798be895 +%global github_version 2.6.0 +%global github_commit 42dae2cbd13154083ca6d70099692fef8ca84bfb %global composer_vendor mtdowling %global composer_project jmespath.php -# "php": ">=5.4.0" -%global php_min_ver 5.4.0 - -# Build using "--without tests" to disable tests -%global with_tests 0%{!?_without_tests:1} +# "php": "^5.4 || ^7.0 || ^8.0" +%global php_min_ver 5.4 %{!?phpdir: %global phpdir %{_datadir}/php} @@ -33,21 +32,23 @@ Summary: Declaratively specify how to extract elements from a JSON documen License: MIT URL: https://github.com/%{github_owner}/%{github_name} -Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +# GitHub export does not include tests. +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildArch: noarch # Tests -%if %{with_tests} +%if %{with tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: phpunit7 >= 7.5.15 ## phpcompatinfo (computed from version 2.5.0) BuildRequires: php-json BuildRequires: php-mbstring BuildRequires: php-spl +%endif ## Autoloader BuildRequires: php-composer(fedora/autoloader) -%endif Requires: php-cli # composer.json @@ -107,20 +108,24 @@ install -pm 0755 bin/jp.php %{buildroot}%{_bindir}/ %check -%if %{with_tests} -: Skip test known to fail -sed 's/function testTokenizesJsonNumbers/function SKIP_testTokenizesJsonNumbers/' \ - -i tests/LexerTest.php - +%if %{with tests} : Run tests -%{_bindir}/phpunit --verbose \ - --bootstrap %{buildroot}%{phpdir}/JmesPath/autoload.php +RETURN_CODE=0 +for PHP_EXEC in php php73 php74 php80; do + if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then + $PHP_EXEC %{_bindir}/phpunit7 \ + --bootstrap %{buildroot}%{phpdir}/JmesPath/autoload.php \ + --verbose || RETURN_CODE=1 + fi +done +exit $RETURN_CODE %else : Tests skipped %endif %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGELOG.md @@ -131,6 +136,10 @@ sed 's/function testTokenizesJsonNumbers/function SKIP_testTokenizesJsonNumbers/ %changelog +* Wed Apr 14 2021 Remi Collet - 2.6.0-1 +- update to 2.6.0 +- switch to phpunit7 + * Wed Feb 12 2020 Shawn Iwinski - 2.5.0-1 - Update to 2.5.0 (RHBZ #1787856) -- cgit