7
7
use Gitlab \Exception \RuntimeException ;
8
8
use Gitlab \HttpClient \Message \ResponseMediator ;
9
9
use GuzzleHttp \Psr7 \Response ;
10
- use function GuzzleHttp \Psr7 \stream_for ;
10
+ use GuzzleHttp \Psr7 \Utils ;
11
11
use PHPUnit \Framework \TestCase ;
12
12
13
13
/**
@@ -21,7 +21,7 @@ public function testGetContent(): void
21
21
$ response = new Response (
22
22
200 ,
23
23
['Content-Type ' => 'application/json ' ],
24
- stream_for ('{"foo": "bar"} ' )
24
+ Utils:: streamFor ('{"foo": "bar"} ' )
25
25
);
26
26
27
27
$ this ->assertSame (['foo ' => 'bar ' ], ResponseMediator::getContent ($ response ));
@@ -32,7 +32,7 @@ public function testGetContentNotJson(): void
32
32
$ response = new Response (
33
33
200 ,
34
34
[],
35
- stream_for ('foobar ' )
35
+ Utils:: streamFor ('foobar ' )
36
36
);
37
37
38
38
$ this ->assertSame ('foobar ' , ResponseMediator::getContent ($ response ));
@@ -43,7 +43,7 @@ public function testGetContentInvalidJson(): void
43
43
$ response = new Response (
44
44
200 ,
45
45
['Content-Type ' => 'application/json ' ],
46
- stream_for ('foobar ' )
46
+ Utils:: streamFor ('foobar ' )
47
47
);
48
48
49
49
$ this ->expectException (RuntimeException::class);
@@ -57,7 +57,7 @@ public function testGetErrrorMessageInvalidJson(): void
57
57
$ response = new Response (
58
58
200 ,
59
59
['Content-Type ' => 'application/json ' ],
60
- stream_for ('foobar ' )
60
+ Utils:: streamFor ('foobar ' )
61
61
);
62
62
63
63
$ this ->assertNull (ResponseMediator::getErrorMessage ($ response ));
0 commit comments