From 22773ded21e3556933b69398634cb499173d0ce7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 29 Mar 2021 15:24:20 +0200 Subject: fix test suite using patch from https://github.com/jeremeamia/super_closure/pull/114 switch to classmap autoloader --- php-jeremeamia-superclosure-autoload.php | 9 --------- php-jeremeamia-superclosure-php8.patch | 22 +++++++++++++++++++++ php-jeremeamia-superclosure.spec | 34 +++++++++++++++++++++++--------- 3 files changed, 47 insertions(+), 18 deletions(-) delete mode 100644 php-jeremeamia-superclosure-autoload.php create mode 100644 php-jeremeamia-superclosure-php8.patch diff --git a/php-jeremeamia-superclosure-autoload.php b/php-jeremeamia-superclosure-autoload.php deleted file mode 100644 index f5e12ea..0000000 --- a/php-jeremeamia-superclosure-autoload.php +++ /dev/null @@ -1,9 +0,0 @@ - +Date: Mon, 29 Mar 2021 15:14:26 +0200 +Subject: [PATCH] Fix char / string + +--- + tests/Unit/SerializerTest.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/Unit/SerializerTest.php b/tests/Unit/SerializerTest.php +index d35d18a..9137c7c 100644 +--- a/tests/Unit/SerializerTest.php ++++ b/tests/Unit/SerializerTest.php +@@ -27,7 +27,7 @@ public function testUnserializingFailsWithInvalidSignature() + $serializedFn = $serializer->serialize($originalFn); + + // Modify the serialized closure. +- $serializedFn[5] = '6119dcd1245df749d162b544d4f44280eef3e7f4d4c636611ed87e7b97198c0b'; ++ $serializedFn[5] = 'x'; + + // Unserialization should fail on invalid signature. + $this->setExpectedException('SuperClosure\Exception\ClosureUnserializationException'); diff --git a/php-jeremeamia-superclosure.spec b/php-jeremeamia-superclosure.spec index 2b37bf7..9edccf7 100644 --- a/php-jeremeamia-superclosure.spec +++ b/php-jeremeamia-superclosure.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for php-jeremeamia-superclosure # -# Copyright (c) 2015-2020 Remi Collet +# Copyright (c) 2015-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -19,7 +19,7 @@ Name: php-%{pk_vendor}-%{pk_name} Version: 2.4.0 -Release: 7%{?dist} +Release: 9%{?dist} Summary: Serialize Closure objects, including their context and binding License: MIT @@ -27,13 +27,15 @@ URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{name}-%{version}-%{gh_short}.tgz # Create git snapshot as tests are excluded from official tarball Source1: makesrc.sh -# Autoloader -Source2: %{name}-autoload.php + +Patch0: %{name}-php8.patch BuildArch: noarch BuildRequires: php(language) >= 7.0 +# remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(nikic/php-parser) >= 4.0 with php-composer(nikic/php-parser) < 5) +# remirepo:3 %else BuildRequires: php-nikic-php-parser4 %endif @@ -41,7 +43,7 @@ BuildRequires: php-nikic-php-parser4 # "phpunit/phpunit": "^4.0|^5.0", BuildRequires: php-composer(phpunit/phpunit) >= 4.0 # Autoloader -BuildRequires: php-composer(fedora/autoloader) +BuildRequires: php-fedora-autoloader-devel # From composer.json, "require": { # "php": ">=5.4", @@ -49,12 +51,14 @@ BuildRequires: php-composer(fedora/autoloader) # "symfony/polyfill-php56": "^1.0" # php-parser 1.4 for autoloader Requires: php(language) >= 7.0 +# remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(nikic/php-parser) >= 4.0 with php-composer(nikic/php-parser) < 5) +# remirepo:3 %else Requires: php-nikic-php-parser4 %endif -# From phpcompatifo report for 2.1.0 +# From phpcompatifo report for 2.4.0 Requires: php-hash Requires: php-reflection Requires: php-spl @@ -74,11 +78,17 @@ Autoloader: %{_datadir}/php/%{namespace}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} -install -pm 644 %{SOURCE2} src/autoload.php +%patch0 -p1 -b .php8 %build -# Nothing +phpab -t fedora -o src/autoload.php src +cat << 'EOF' | tee -a src/autoload.php + +\Fedora\Autoloader\Dependencies::required([ + '%{_datadir}/php/PhpParser4/autoload.php', +]); +EOF %install @@ -98,7 +108,7 @@ EOF : Run the test suite ret=0 -for cmd in php php72 php73 php74; do +for cmd in php php73 php74 php80; do if which $cmd; then $cmd %{_bindir}/phpunit || ret=1 fi @@ -107,6 +117,7 @@ exit $ret %files +# remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE.md %doc README.md composer.json @@ -114,6 +125,11 @@ exit $ret %changelog +* Mon Mar 29 2021 Remi Collet - 2.4.0-9 +- fix test suite using patch from + https://github.com/jeremeamia/super_closure/pull/114 +- switch to classmap autoloader + * Mon Oct 26 2020 Remi Collet - 2.4.0-7 - raise dependency on PHP 7.0 - raise dependency on nikic/php-parser 4.0 -- cgit