From 89adc07d54908e6ce00978123a4390c999db0564 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 24 Aug 2020 11:50:38 +0200 Subject: add patches for PHP 8 from upstream and from https://github.com/jbboehr/php-psr/pull/77 --- 87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch | 167 +++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch (limited to '87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch') diff --git a/87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch b/87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch new file mode 100644 index 0000000..e4aeeb5 --- /dev/null +++ b/87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch @@ -0,0 +1,167 @@ +From 87855e941d39fc9ebcee3a84f0f73ce4103d236d Mon Sep 17 00:00:00 2001 +From: John Boehr +Date: Sat, 27 Jun 2020 21:23:13 -0700 +Subject: [PATCH] Patch tests to pass on latest PHP master (8.0.0alpha1) + +--- + tests/PsrHttpClientClientExceptionInterface.phpt | 7 ++----- + tests/PsrHttpClientNetworkExceptionInterface.phpt | 11 ++++------- + tests/PsrHttpClientRequestExceptionInterface.phpt | 11 ++++------- + tests/PsrHttpMessageStreamInterface.phpt | 10 ++++------ + tests/PsrHttpMessageUriInterface.phpt | 10 ++++------ + tests/SampleStream.inc | 1 + + 6 files changed, 19 insertions(+), 31 deletions(-) + +diff --git a/tests/PsrHttpClientClientExceptionInterface.phpt b/tests/PsrHttpClientClientExceptionInterface.phpt +index 52a06be..4a01f16 100644 +--- a/tests/PsrHttpClientClientExceptionInterface.phpt ++++ b/tests/PsrHttpClientClientExceptionInterface.phpt +@@ -5,7 +5,7 @@ Psr\Http\Client\ClientExceptionInterface + --FILE-- + getMessage()); + } + --EXPECT-- +-array(1) { +- ["Throwable"]=> +- string(9) "Throwable" +-} ++bool(true) + bool(true) + bool(true) + bool(true) +diff --git a/tests/PsrHttpClientNetworkExceptionInterface.phpt b/tests/PsrHttpClientNetworkExceptionInterface.phpt +index 4ad60b7..eb2aafa 100644 +--- a/tests/PsrHttpClientNetworkExceptionInterface.phpt ++++ b/tests/PsrHttpClientNetworkExceptionInterface.phpt +@@ -8,7 +8,8 @@ use Psr\Http\Message\RequestInterface; + use Psr\Http\Client\NetworkExceptionInterface; + include __DIR__ . '/SampleMessage.inc'; + include __DIR__ . '/SampleRequest.inc'; +-var_dump(class_implements('Psr\Http\Client\NetworkExceptionInterface', false)); ++var_dump(is_subclass_of(NetworkExceptionInterface::class, Psr\Http\Client\ClientExceptionInterface::class)); ++var_dump(is_subclass_of(NetworkExceptionInterface::class, Throwable::class)); + class MyException extends Exception implements NetworkExceptionInterface { + public function getRequest(): RequestInterface { + var_dump(__METHOD__); +@@ -27,12 +28,8 @@ try { + var_dump($e->getRequest()); + } + --EXPECTF-- +-array(2) { +- ["Psr\Http\Client\ClientExceptionInterface"]=> +- string(40) "Psr\Http\Client\ClientExceptionInterface" +- ["Throwable"]=> +- string(9) "Throwable" +-} ++bool(true) ++bool(true) + bool(true) + bool(true) + bool(true) +diff --git a/tests/PsrHttpClientRequestExceptionInterface.phpt b/tests/PsrHttpClientRequestExceptionInterface.phpt +index 248d882..e927ccf 100644 +--- a/tests/PsrHttpClientRequestExceptionInterface.phpt ++++ b/tests/PsrHttpClientRequestExceptionInterface.phpt +@@ -8,7 +8,8 @@ use Psr\Http\Message\RequestInterface; + use Psr\Http\Client\RequestExceptionInterface; + include __DIR__ . '/SampleMessage.inc'; + include __DIR__ . '/SampleRequest.inc'; +-var_dump(class_implements('Psr\Http\Client\RequestExceptionInterface', false)); ++var_dump(is_subclass_of(RequestExceptionInterface::class, Psr\Http\Client\ClientExceptionInterface::class)); ++var_dump(is_subclass_of(RequestExceptionInterface::class, Throwable::class)); + class MyException extends Exception implements RequestExceptionInterface { + public function getRequest(): RequestInterface { + var_dump(__METHOD__); +@@ -27,12 +28,8 @@ try { + var_dump($e->getRequest()); + } + --EXPECTF-- +-array(2) { +- ["Psr\Http\Client\ClientExceptionInterface"]=> +- string(40) "Psr\Http\Client\ClientExceptionInterface" +- ["Throwable"]=> +- string(9) "Throwable" +-} ++bool(true) ++bool(true) + bool(true) + bool(true) + bool(true) +diff --git a/tests/PsrHttpMessageStreamInterface.phpt b/tests/PsrHttpMessageStreamInterface.phpt +index 3232bfc..62d6b79 100644 +--- a/tests/PsrHttpMessageStreamInterface.phpt ++++ b/tests/PsrHttpMessageStreamInterface.phpt +@@ -4,9 +4,10 @@ Psr\Http\Message\StreamInterface + + --FILE-- + __toString(); + $stream->close(); +@@ -25,10 +26,7 @@ $stream->getContents(); + $stream->getMetadata(); + --EXPECTF-- + bool(true) +-array(1) { +- ["Psr\Http\Message\StreamInterface"]=> +- string(32) "Psr\Http\Message\StreamInterface" +-} ++bool(true) + string(24) "SampleStream::__toString" + string(19) "SampleStream::close" + string(20) "SampleStream::detach" +diff --git a/tests/PsrHttpMessageUriInterface.phpt b/tests/PsrHttpMessageUriInterface.phpt +index 8ed65f8..278ed69 100644 +--- a/tests/PsrHttpMessageUriInterface.phpt ++++ b/tests/PsrHttpMessageUriInterface.phpt +@@ -4,9 +4,10 @@ Psr\Http\Message\UriInterface + + --FILE-- + getScheme(); + $uri->getAuthority(); +@@ -26,10 +27,7 @@ $uri->withFragment(''); + $uri->__toString(); + --EXPECT-- + bool(true) +-array(1) { +- ["Psr\Http\Message\UriInterface"]=> +- string(29) "Psr\Http\Message\UriInterface" +-} ++bool(true) + string(20) "SampleUri::getScheme" + string(23) "SampleUri::getAuthority" + string(22) "SampleUri::getUserInfo" +diff --git a/tests/SampleStream.inc b/tests/SampleStream.inc +index 311236f..96a0bb0 100644 +--- a/tests/SampleStream.inc ++++ b/tests/SampleStream.inc +@@ -7,6 +7,7 @@ class SampleStream implements StreamInterface + public function __toString() + { + var_dump(__METHOD__); ++ return __METHOD__; + } + + public function close() -- cgit