diff options
author | Remi Collet <remi@remirepo.net> | 2020-08-24 11:50:38 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-08-24 11:50:38 +0200 |
commit | 89adc07d54908e6ce00978123a4390c999db0564 (patch) | |
tree | 1dd85b146a5395b05bc5dd409ade761bfcb45f00 /87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch | |
parent | 2921700301f98056a944580f5c09d3ab3cc932dc (diff) |
add patches for PHP 8 from upstream and from
https://github.com/jbboehr/php-psr/pull/77
Diffstat (limited to '87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch')
-rw-r--r-- | 87855e941d39fc9ebcee3a84f0f73ce4103d236d.patch | 167 |
1 files changed, 167 insertions, 0 deletions
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 <john@johnboehr.is> +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-- + <?php + use Psr\Http\Client\ClientExceptionInterface; +-var_dump(class_implements('Psr\Http\Client\ClientExceptionInterface', false)); ++var_dump(is_subclass_of(ClientExceptionInterface::class, Throwable::class)); + class MyException extends Exception implements ClientExceptionInterface {} + $ex = new MyException('test'); + var_dump($ex instanceof ClientExceptionInterface); +@@ -17,10 +17,7 @@ try { + var_dump($e->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 + <?php include('skip.inc'); ?> + --FILE-- + <?php ++use Psr\Http\Message\StreamInterface; + include __DIR__ . '/SampleStream.inc'; +-var_dump(interface_exists('\\Psr\\Http\\Message\\StreamInterface', false)); +-var_dump(class_implements('SampleStream', false)); ++var_dump(interface_exists(StreamInterface::class, false)); ++var_dump(is_subclass_of(SampleStream::class, StreamInterface::class)); + $stream = new SampleStream(); + $stream->__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 + <?php include('skip.inc'); ?> + --FILE-- + <?php ++use Psr\Http\Message\UriInterface; + include __DIR__ . '/SampleUri.inc'; +-var_dump(interface_exists('\\Psr\\Http\\Message\\UriInterface', false)); +-var_dump(class_implements('SampleUri', false)); ++var_dump(interface_exists(UriInterface::class, false)); ++var_dump(is_subclass_of(SampleUri::class, UriInterface::class)); + $uri = new SampleUri(); + $uri->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() |