From 5886f2d426a86aca8ad68dc3dcbd2acc34e402c5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 23 Mar 2021 16:19:39 +0100 Subject: update to 1.5.6 switch to phpunit7 and fix FTBFS with PHP 8 --- .gitignore | 2 ++ php-simplepie-tests.patch | 23 +++++++++++++++++++++++ php-simplepie.spec | 28 ++++++++++++++-------------- 3 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 php-simplepie-tests.patch diff --git a/.gitignore b/.gitignore index 1ab5c4f..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/php-simplepie-tests.patch b/php-simplepie-tests.patch new file mode 100644 index 0000000..622a22d --- /dev/null +++ b/php-simplepie-tests.patch @@ -0,0 +1,23 @@ +diff -up ./tests/CacheTest.php.php8 ./tests/CacheTest.php +--- ./tests/CacheTest.php.php8 2021-03-23 16:04:28.360182642 +0100 ++++ ./tests/CacheTest.php 2021-03-23 16:04:50.771096776 +0100 +@@ -76,6 +76,7 @@ class CacheTest extends PHPUnit\Framewor + { + /** + * @expectedException Exception_Success ++ * @requires PHP < 8 + */ + public function testDirectOverrideLegacy() + { +diff -up ./tests/EncodingTest.php.php8 ./tests/EncodingTest.php +--- ./tests/EncodingTest.php.php8 2021-03-23 16:06:41.482672604 +0100 ++++ ./tests/EncodingTest.php 2021-03-23 16:06:46.003655284 +0100 +@@ -182,7 +182,7 @@ class EncodingTest extends PHPUnit\Frame + $this->assertFalse(SimplePie_Misc::change_encoding('', 'TESTENC', 'UTF-8')); + } + +- public static function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) ++ public static function assertEquals($expected, $actual, string $message = '', float $delta = 0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void + { + if (is_string($expected)) + { diff --git a/php-simplepie.spec b/php-simplepie.spec index 06c887a..6b62067 100644 --- a/php-simplepie.spec +++ b/php-simplepie.spec @@ -7,11 +7,11 @@ # # Please preserve changelog entries # -%global gh_commit ae49e2201b6da9c808e5dac437aca356a11831b4 +%global gh_commit 1c68e14ca3ac84346b6e6fe3c5eedf725d0f92c6 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner simplepie %global gh_project simplepie -%global gh_version 1.5.5 +%global gh_version 1.5.6 %bcond_without tests Name: php-%{gh_project} @@ -30,20 +30,15 @@ Source1: %{name}-makesrc.sh # Adapt autoloader for installation tree Patch0: %{name}-rpm.patch +# Adpat to phpunit7 and php 8 +Patch1: %{name}-tests.patch BuildArch: noarch %if %{with tests} # From composer.json, "require-dev" # "phpunit/phpunit": "~5.4.3 || ~6.5" -# remirepo:1 -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: phpunit6 >= 6.5 -%global phpunit %{_bindir}/phpunit6 -# remirepo:4 -%else -BuildRequires: php-phpunit-PHPUnit -%global phpunit %{_bindir}/phpunit -%endif +BuildRequires: phpunit7 +%global phpunit %{_bindir}/phpunit7 %endif # from composer.json, "require" @@ -89,6 +84,7 @@ Autoloader: %{_datadir}/php/%{name}/autoloader.php %setup -qn %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm +%patch1 -p1 -b .php8 # fix rpmlint warnings find . -type f -exec chmod -x {} \; @@ -114,11 +110,10 @@ sed -e 's:@PATH@:%{buildroot}/%{_datadir}/php/%{name}:' \ -i tests/bootstrap.php ret=0 -# TODO php 8 Errors: 1, Failures: 1. -for cmdarg in "php %{phpunit}" php72 php73 php74; do +for cmdarg in "php %{phpunit}" php73 php74 php80; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit6} --verbose || ret=1 + $1 ${2:-%{_bindir}/phpunit7} --verbose || ret=1 fi done exit $ret @@ -126,6 +121,7 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE.txt %doc composer.json @@ -135,6 +131,10 @@ exit $ret %changelog +* Tue Mar 23 2021 Remi Collet - 1.5.6-1 +- update to 1.5.6 +- switch to phpunit7 and fix FTBFS with PHP 8 + * Wed Jul 1 2020 Remi Collet - 1.5.5-1 - update to 1.5.5 -- cgit