44
55namespace Http \Client \Curl \Tests \Unit ;
66
7+ use GuzzleHttp \Psr7 \Utils ;
78use Http \Client \Curl \Client ;
89use PHPUnit \Framework \TestCase ;
910use Psr \Http \Message \ResponseFactoryInterface ;
@@ -83,14 +84,13 @@ public function testRewindLargeStream(): void
8384 }
8485
8586 $ length = strlen ($ content );
86- $ body = \ GuzzleHttp \ Psr7 \stream_for ($ content );
87+ $ body = Utils:: streamFor ($ content );
8788 $ body ->seek (40 );
8889 $ request = new Request ('http://foo.com ' , 'POST ' , $ body );
8990 $ options = $ bodyOptions ->invoke ($ client , $ request , []);
9091
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 '
9494 );
9595 }
9696
@@ -101,7 +101,7 @@ public function testRewindStream(): void
101101 $ bodyOptions = new \ReflectionMethod (Client::class, 'addRequestBodyOptions ' );
102102 $ bodyOptions ->setAccessible (true );
103103
104- $ body = \ GuzzleHttp \ Psr7 \stream_for ('abcdef ' );
104+ $ body = Utils:: streamFor ('abcdef ' );
105105 $ body ->seek (3 );
106106 $ request = new Request ('http://foo.com ' , 'POST ' , $ body );
107107 $ options = $ bodyOptions ->invoke ($ client , $ request , []);
0 commit comments