From 11c12cbf0330727dfad20d35318b3853f876277d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 30 Jun 2022 09:09:32 +0200 Subject: add upstream patch for 8.2 skip test suite with PHP >= 8.1 --- php-mikey179-vfsstream-upstream.patch | 45 +++++++++++++++++++++++++++++++++++ php-mikey179-vfsstream.spec | 24 +++++++++++++------ 2 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 php-mikey179-vfsstream-upstream.patch diff --git a/php-mikey179-vfsstream-upstream.patch b/php-mikey179-vfsstream-upstream.patch new file mode 100644 index 0000000..0d93966 --- /dev/null +++ b/php-mikey179-vfsstream-upstream.patch @@ -0,0 +1,45 @@ +From 17b0f39b4a767bf950066dbad1a9a0b0ec4f7c68 Mon Sep 17 00:00:00 2001 +From: Vladimir Jimenez +Date: Tue, 22 Feb 2022 17:36:32 -0800 +Subject: [PATCH] Fix PHP 8.2 support for vfsStreamWrapper + +Co-authored-by: James Gilliland +--- + src/main/php/org/bovigo/vfs/vfsStreamWrapper.php | 6 ++++++ + src/test/phpt/bug71287.phpt | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php b/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php +index 368b2fbe..a31e6d22 100644 +--- a/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php ++++ b/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php +@@ -46,6 +46,12 @@ class vfsStreamWrapper + * file mode: read and write + */ + const ALL = 2; ++ /** ++ * The current context or null if none passed. ++ * ++ * @var resource|null ++ */ ++ public $context; + /** + * switch whether class has already been registered as stream wrapper or not + * +diff --git a/src/test/phpt/bug71287.phpt b/src/test/phpt/bug71287.phpt +index ea2efb75..75b9b376 100644 +--- a/src/test/phpt/bug71287.phpt ++++ b/src/test/phpt/bug71287.phpt +@@ -6,6 +6,12 @@ See https://github.com/mikey179/vfsStream/issues/120 + --FILE-- + = 5.3 BuildRequires: %{_bindir}/phpab @@ -61,6 +64,7 @@ To use this library, you just have to add, in your project: %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 %build @@ -83,14 +87,16 @@ rm src/test/php/org/bovigo/vfs/vfsStreamWrapperLargeFileTestCase.php mkdir vendor ln -s %{buildroot}%{_datadir}/php/org/bovigo/vfs/autoload.php vendor/autoload.php -# issue with PHP 8 and phpunit 5: unregisterThirdPartyVfsScheme|unregisterWhenNotInRegisteredState -# TODO PHP 8.1 ret=0 -for cmd in php php73 php74 php80; do +for cmd in php php74 php80; do if which $cmd; then - $cmd %{_bindir}/phpunit \ + VER=$($cmd -r 'echo PHP_VERSION_ID;') + if [ $VER -ge 80100 ]; then + echo skip test with PHP $ver + else $cmd %{_bindir}/phpunit \ --filter '^((?!(unregisterThirdPartyVfsScheme|unregisterWhenNotInRegisteredState)).)*$' \ - --verbose || ret=1 + --verbose --no-coverage || ret=1 + fi fi done exit $ret @@ -109,6 +115,10 @@ exit $ret %changelog +* Thu Jun 30 2022 Remi Collet - 1.6.10-2 +- add upstream patch for 8.2 +- skip test suite with PHP >= 8.1 + * Mon Sep 27 2021 Remi Collet - 1.6.10-1 - update to 1.6.10 -- cgit