4
4
5
5
namespace Http \Client \Curl \Tests \Unit ;
6
6
7
+ use GuzzleHttp \Psr7 \Utils ;
7
8
use Http \Client \Curl \Client ;
8
9
use PHPUnit \Framework \TestCase ;
9
10
use Psr \Http \Message \ResponseFactoryInterface ;
@@ -83,14 +84,13 @@ public function testRewindLargeStream(): void
83
84
}
84
85
85
86
$ length = strlen ($ content );
86
- $ body = \ GuzzleHttp \ Psr7 \stream_for ($ content );
87
+ $ body = Utils:: streamFor ($ content );
87
88
$ body ->seek (40 );
88
89
$ request = new Request ('http://foo.com ' , 'POST ' , $ body );
89
90
$ options = $ bodyOptions ->invoke ($ client , $ request , []);
90
91
91
- static ::assertTrue (
92
- false !== strstr ($ options [CURLOPT_READFUNCTION ](null , null , $ length ), 'abcdef ' ),
93
- 'Steam was not rewinded '
92
+ static ::assertNotFalse (
93
+ strpos ($ options [CURLOPT_READFUNCTION ](null , null , $ length ), 'abcdef ' ), 'Steam was not rewinded '
94
94
);
95
95
}
96
96
@@ -101,7 +101,7 @@ public function testRewindStream(): void
101
101
$ bodyOptions = new \ReflectionMethod (Client::class, 'addRequestBodyOptions ' );
102
102
$ bodyOptions ->setAccessible (true );
103
103
104
- $ body = \ GuzzleHttp \ Psr7 \stream_for ('abcdef ' );
104
+ $ body = Utils:: streamFor ('abcdef ' );
105
105
$ body ->seek (3 );
106
106
$ request = new Request ('http://foo.com ' , 'POST ' , $ body );
107
107
$ options = $ bodyOptions ->invoke ($ client , $ request , []);
0 commit comments