8
8
use GuzzleHttp \Psr7 \Response ;
9
9
use GuzzleHttp \Psr7 \ServerRequest ;
10
10
use GuzzleHttp \Psr7 \Uri ;
11
+ use GuzzleHttp \Psr7 \Utils ;
11
12
use HansOtt \PSR7Cookies \SetCookie ;
12
13
use InvalidArgumentException ;
13
14
use PHPUnit \Framework \TestCase ;
14
15
use Psr \Http \Message \RequestInterface ;
15
16
use Psr \Http \Message \ResponseInterface ;
16
17
use Psr \Http \Message \ServerRequestInterface ;
17
18
18
- use function GuzzleHttp \Psr7 \stream_for ;
19
19
use function json_encode ;
20
20
use function sprintf ;
21
21
@@ -33,7 +33,7 @@ protected function makeGoodResponse(string $path, string $method): ResponseInter
33
33
return (new Response ())
34
34
->withHeader ('Content-Type ' , 'application/json ' )
35
35
->withHeader ('Header-B ' , 'good value ' )
36
- ->withBody (stream_for (json_encode ($ body )));
36
+ ->withBody (Utils:: streamFor (json_encode ($ body )));
37
37
38
38
case 'post /cookies ' :
39
39
$ response = (new Response ())
@@ -72,7 +72,7 @@ protected function makeGoodServerRequest(string $path, string $method): ServerRe
72
72
73
73
return $ request
74
74
->withHeader ('Content-Type ' , 'application/json ' )
75
- ->withBody (stream_for (json_encode ($ body )));
75
+ ->withBody (Utils:: streamFor (json_encode ($ body )));
76
76
77
77
default :
78
78
throw new InvalidArgumentException (sprintf ("unexpected operation '%s %s'' " , $ method , $ path ));
@@ -104,7 +104,7 @@ protected function makeGoodRequest(string $path, string $method): RequestInterfa
104
104
105
105
return $ request
106
106
->withHeader ('Content-Type ' , 'application/json ' )
107
- ->withBody (stream_for (json_encode ($ body )));
107
+ ->withBody (Utils:: streamFor (json_encode ($ body )));
108
108
109
109
default :
110
110
throw new InvalidArgumentException (sprintf ("unexpected operation '%s %s'' " , $ method , $ path ));
0 commit comments