File tree 7 files changed +35
-27
lines changed
7 files changed +35
-27
lines changed Original file line number Diff line number Diff line change 11
11
}
12
12
],
13
13
"require" : {
14
- "php" : " ^7.2" ,
14
+ "php" : " ^7.2 | ^8.0 " ,
15
15
"php-http/httplug" : " ^2.0" ,
16
16
"psr/http-client" : " ^1.0" ,
17
17
"guzzlehttp/guzzle" : " ^7.0"
18
18
},
19
19
"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"
22
22
},
23
23
"provide" : {
24
24
"php-http/client-implementation" : " 1.0" ,
Original file line number Diff line number Diff line change 1
1
<?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 >
16
20
</phpunit >
Original file line number Diff line number Diff line change 6
6
7
7
use Http \Adapter \Guzzle7 \Client ;
8
8
use Http \Client \Tests \HttpClientTest ;
9
+ use Psr \Http \Client \ClientInterface ;
9
10
10
11
/**
11
12
* @author David Buchmann <[email protected] >
@@ -15,7 +16,7 @@ class DefaultHttpAdapterTest extends HttpClientTest
15
16
/**
16
17
* {@inheritdoc}
17
18
*/
18
- protected function createHttpAdapter ()
19
+ protected function createHttpAdapter (): ClientInterface
19
20
{
20
21
return new Client ();
21
22
}
Original file line number Diff line number Diff line change 7
7
use GuzzleHttp \Client as GuzzleClient ;
8
8
use Http \Adapter \Guzzle7 \Client ;
9
9
use Http \Client \Tests \HttpClientTest ;
10
+ use Psr \Http \Client \ClientInterface ;
10
11
11
12
/**
12
13
* @author GeLo <[email protected] >
@@ -16,7 +17,7 @@ abstract class HttpAdapterTest extends HttpClientTest
16
17
/**
17
18
* {@inheritdoc}
18
19
*/
19
- protected function createHttpAdapter ()
20
+ protected function createHttpAdapter (): ClientInterface
20
21
{
21
22
return new Client (new GuzzleClient (['handler ' => $ this ->createHandler ()]));
22
23
}
Original file line number Diff line number Diff line change 6
6
7
7
use GuzzleHttp \Client as GuzzleClient ;
8
8
use Http \Adapter \Guzzle7 \Client ;
9
+ use Http \Client \HttpAsyncClient ;
9
10
use Http \Client \Tests \HttpAsyncClientTest ;
10
11
11
12
/**
@@ -16,7 +17,7 @@ abstract class HttpAsyncAdapterTest extends HttpAsyncClientTest
16
17
/**
17
18
* {@inheritdoc}
18
19
*/
19
- protected function createHttpAsyncClient ()
20
+ protected function createHttpAsyncClient (): HttpAsyncClient
20
21
{
21
22
return new Client (new GuzzleClient (['handler ' => $ this ->createHandler ()]));
22
23
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public function testExceptionThatIsThrownForGuzzleException(
28
28
RequestInterface $ request ,
29
29
$ reason ,
30
30
string $ adapterExceptionClass
31
- ) {
31
+ ): void {
32
32
$ guzzlePromise = new \GuzzleHttp \Promise \Promise ();
33
33
$ guzzlePromise ->reject ($ reason );
34
34
$ promise = new Promise ($ guzzlePromise , $ request );
Original file line number Diff line number Diff line change 4
4
5
5
namespace Http \Adapter \Guzzle7 \Tests ;
6
6
7
+ use Exception ;
7
8
use GuzzleHttp \Promise \RejectedPromise ;
8
9
use Http \Adapter \Guzzle7 \Promise ;
9
10
use PHPUnit \Framework \TestCase ;
11
+ use Psr \Http \Message \RequestInterface ;
10
12
11
13
/**
12
14
* @author Márk Sági-Kazár <[email protected] >
13
15
*/
14
16
class PromiseTest extends TestCase
15
17
{
16
- /**
17
- * @expectedException \Exception
18
- */
19
- public function testNonDomainExceptionIsHandled ()
18
+ public function testNonDomainExceptionIsHandled (): void
20
19
{
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 ());
23
24
24
25
$ guzzlePromise = new Promise ($ promise , $ request ->reveal ());
25
26
You can’t perform that action at this time.
0 commit comments