File tree Expand file tree Collapse file tree 7 files changed +35
-27
lines changed Expand file tree Collapse file tree 7 files changed +35
-27
lines changed Original file line number Diff line number Diff line change 1111 }
1212 ],
1313 "require" : {
14- "php" : " ^7.2" ,
14+ "php" : " ^7.2 | ^8.0 " ,
1515 "php-http/httplug" : " ^2.0" ,
1616 "psr/http-client" : " ^1.0" ,
1717 "guzzlehttp/guzzle" : " ^7.0"
1818 },
1919 "require-dev" : {
20- "phpunit/phpunit" : " ^7.4 " ,
21- "php-http/client-integration-tests" : " ^2 .0"
20+ "phpunit/phpunit" : " ^8.0|^9.3 " ,
21+ "php-http/client-integration-tests" : " ^3 .0"
2222 },
2323 "provide" : {
2424 "php-http/client-implementation" : " 1.0" ,
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit colors =" true" bootstrap =" vendor/autoload.php" >
3- <testsuites >
4- <testsuite name =" Guzzle 7 HTTP Adapter Test Suite" >
5- <directory >tests/</directory >
6- </testsuite >
7- </testsuites >
8- <php >
9- <server name =" TEST_SERVER" value =" http://127.0.0.1:10000/server.php" />
10- </php >
11- <filter >
12- <whitelist >
13- <directory suffix =" .php" >src/</directory >
14- </whitelist >
15- </filter >
2+ <phpunit
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ colors =" true"
5+ bootstrap =" vendor/autoload.php"
6+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd" >
7+ <coverage >
8+ <include >
9+ <directory suffix =" .php" >src/</directory >
10+ </include >
11+ </coverage >
12+ <testsuites >
13+ <testsuite name =" Guzzle 7 HTTP Adapter Test Suite" >
14+ <directory >tests/</directory >
15+ </testsuite >
16+ </testsuites >
17+ <php >
18+ <server name =" TEST_SERVER" value =" http://127.0.0.1:10000/server.php" />
19+ </php >
1620</phpunit >
Original file line number Diff line number Diff line change 66
77use Http \Adapter \Guzzle7 \Client ;
88use Http \Client \Tests \HttpClientTest ;
9+ use Psr \Http \Client \ClientInterface ;
910
1011/**
1112 * @author David Buchmann <[email protected] > @@ -15,7 +16,7 @@ class DefaultHttpAdapterTest extends HttpClientTest
1516 /**
1617 * {@inheritdoc}
1718 */
18- protected function createHttpAdapter ()
19+ protected function createHttpAdapter (): ClientInterface
1920 {
2021 return new Client ();
2122 }
Original file line number Diff line number Diff line change 77use GuzzleHttp \Client as GuzzleClient ;
88use Http \Adapter \Guzzle7 \Client ;
99use Http \Client \Tests \HttpClientTest ;
10+ use Psr \Http \Client \ClientInterface ;
1011
1112/**
1213 * @author GeLo <[email protected] > @@ -16,7 +17,7 @@ abstract class HttpAdapterTest extends HttpClientTest
1617 /**
1718 * {@inheritdoc}
1819 */
19- protected function createHttpAdapter ()
20+ protected function createHttpAdapter (): ClientInterface
2021 {
2122 return new Client (new GuzzleClient (['handler ' => $ this ->createHandler ()]));
2223 }
Original file line number Diff line number Diff line change 66
77use GuzzleHttp \Client as GuzzleClient ;
88use Http \Adapter \Guzzle7 \Client ;
9+ use Http \Client \HttpAsyncClient ;
910use Http \Client \Tests \HttpAsyncClientTest ;
1011
1112/**
@@ -16,7 +17,7 @@ abstract class HttpAsyncAdapterTest extends HttpAsyncClientTest
1617 /**
1718 * {@inheritdoc}
1819 */
19- protected function createHttpAsyncClient ()
20+ protected function createHttpAsyncClient (): HttpAsyncClient
2021 {
2122 return new Client (new GuzzleClient (['handler ' => $ this ->createHandler ()]));
2223 }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function testExceptionThatIsThrownForGuzzleException(
2828 RequestInterface $ request ,
2929 $ reason ,
3030 string $ adapterExceptionClass
31- ) {
31+ ): void {
3232 $ guzzlePromise = new \GuzzleHttp \Promise \Promise ();
3333 $ guzzlePromise ->reject ($ reason );
3434 $ promise = new Promise ($ guzzlePromise , $ request );
Original file line number Diff line number Diff line change 44
55namespace Http \Adapter \Guzzle7 \Tests ;
66
7+ use Exception ;
78use GuzzleHttp \Promise \RejectedPromise ;
89use Http \Adapter \Guzzle7 \Promise ;
910use PHPUnit \Framework \TestCase ;
11+ use Psr \Http \Message \RequestInterface ;
1012
1113/**
1214 * @author Márk Sági-Kazár <[email protected] > 1315 */
1416class PromiseTest extends TestCase
1517{
16- /**
17- * @expectedException \Exception
18- */
19- public function testNonDomainExceptionIsHandled ()
18+ public function testNonDomainExceptionIsHandled (): void
2019 {
21- $ request = $ this ->prophesize ('Psr\Http\Message\RequestInterface ' );
22- $ promise = new RejectedPromise (new \Exception ());
20+ $ this ->expectException (Exception::class);
21+
22+ $ request = $ this ->prophesize (RequestInterface::class);
23+ $ promise = new RejectedPromise (new Exception ());
2324
2425 $ guzzlePromise = new Promise ($ promise , $ request ->reveal ());
2526
You can’t perform that action at this time.
0 commit comments