@@ -40,15 +40,15 @@ public function testRun() : void
4040 {
4141 $ request = new Request ('https://www.google.com ' );
4242 $ request ->setHeader ('Content-Type ' , 'text/html ' );
43- $ response = $ this ->client ->run ($ request );
43+ $ response = $ this ->client ->send ($ request );
4444 self ::assertSame ($ request , $ response ->getRequest ());
4545 self ::assertInstanceOf (Response::class, $ response );
4646 self ::assertGreaterThan (100 , \strlen ($ response ->getBody ()));
4747 self ::assertEmpty ($ response ->getInfo ());
4848 $ request ->setOption (\CURLOPT_RETURNTRANSFER , false );
4949 \ob_start (); // Avoid terminal output
5050 $ request ->setGetInfo ();
51- $ response = $ this ->client ->run ($ request );
51+ $ response = $ this ->client ->send ($ request );
5252 self ::assertInstanceOf (Response::class, $ response );
5353 self ::assertSame ('' , $ response ->getBody ());
5454 self ::assertGreaterThan (100 , \strlen ((string ) \ob_get_contents ()));
@@ -61,17 +61,17 @@ public function testProtocolsAndReasons() : void
6161 $ request = new Request ('https://www.google.com ' );
6262 $ request ->setProtocol ('HTTP/1.1 ' );
6363 self ::assertSame ('HTTP/1.1 ' , $ request ->getProtocol ());
64- $ response = $ this ->client ->run ($ request );
64+ $ response = $ this ->client ->send ($ request );
6565 self ::assertSame ('HTTP/1.1 ' , $ response ->getProtocol ());
6666 self ::assertSame ('OK ' , $ response ->getStatusReason ());
6767 $ request ->setProtocol ('HTTP/2.0 ' );
6868 self ::assertSame ('HTTP/2.0 ' , $ request ->getProtocol ());
69- $ response = $ this ->client ->run ($ request );
69+ $ response = $ this ->client ->send ($ request );
7070 self ::assertSame ('HTTP/2 ' , $ response ->getProtocol ());
7171 self ::assertSame ('OK ' , $ response ->getStatusReason ());
7272 $ request ->setProtocol ('HTTP/2 ' );
7373 self ::assertSame ('HTTP/2 ' , $ request ->getProtocol ());
74- $ response = $ this ->client ->run ($ request );
74+ $ response = $ this ->client ->send ($ request );
7575 self ::assertSame ('HTTP/2 ' , $ response ->getProtocol ());
7676 // HTTP/1.0 is failing:
7777 // OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0
@@ -87,19 +87,19 @@ public function testMethods() : void
8787 $ request = new Request ('https://www.google.com ' );
8888 $ request ->setMethod ('post ' );
8989 self ::assertSame ('POST ' , $ request ->getMethod ());
90- $ response = $ this ->client ->run ($ request );
90+ $ response = $ this ->client ->send ($ request );
9191 self ::assertInstanceOf (Response::class, $ response );
9292 $ request ->setMethod ('put ' );
9393 self ::assertSame ('PUT ' , $ request ->getMethod ());
94- $ response = $ this ->client ->run ($ request );
94+ $ response = $ this ->client ->send ($ request );
9595 self ::assertInstanceOf (Response::class, $ response );
9696 }
9797
9898 public function testRunError () : void
9999 {
100100 $ request = new Request ('http://domain.tld ' );
101101 try {
102- $ this ->client ->run ($ request );
102+ $ this ->client ->send ($ request );
103103 } catch (RequestException $ exception ) {
104104 $ expected = \str_starts_with ($ exception ->getMessage (), 'Could ' )
105105 ? 0
@@ -123,7 +123,7 @@ public function testRunErrorWithInfo() : void
123123 $ request = new Request ('http://domain.tld ' );
124124 $ request ->setGetInfo ();
125125 try {
126- $ this ->client ->run ($ request );
126+ $ this ->client ->send ($ request );
127127 } catch (RequestException $ exception ) {
128128 self ::assertSame (0 , $ exception ->getInfo ()['http_code ' ]);
129129 }
@@ -138,7 +138,7 @@ public function testRunWithRequestDownloadFunction() : void
138138 self ::assertInstanceOf (\CurlHandle::class, $ handle );
139139 $ page .= $ data ;
140140 });
141- $ response = $ this ->client ->run ($ request );
141+ $ response = $ this ->client ->send ($ request );
142142 self ::assertSame ('' , $ response ->getBody ());
143143 self ::assertStringContainsString ('<!doctype html> ' , $ page );
144144 self ::assertStringContainsString ('</html> ' , $ page );
@@ -159,7 +159,7 @@ public function testRunMulti() : void
159159 'req3 ' => $ req3 ,
160160 ];
161161 $ finished = [];
162- $ responses = $ this ->client ->runMulti ($ requests );
162+ $ responses = $ this ->client ->sendMulti ($ requests );
163163 while ($ responses ->valid ()) {
164164 $ key = $ responses ->key ();
165165 self ::assertArrayHasKey ($ key , $ requests );
@@ -181,7 +181,7 @@ public function testRunMultiGettingResponseInfo() : void
181181 ];
182182 $ requests [0 ]->setGetInfo ();
183183 $ requests [1 ]->setGetInfo ();
184- $ responses = $ this ->client ->runMulti ($ requests );
184+ $ responses = $ this ->client ->sendMulti ($ requests );
185185 $ returned = [];
186186 while ($ responses ->valid ()) {
187187 $ key = $ responses ->key ();
@@ -205,7 +205,7 @@ public function testResponseError() : void
205205 3 => new Request ('https://aplus-framework.com/xxx ' ),
206206 ];
207207 $ responses = [];
208- foreach ($ this ->client ->runMulti ($ requests ) as $ id => $ response ) {
208+ foreach ($ this ->client ->sendMulti ($ requests ) as $ id => $ response ) {
209209 $ responses [$ id ] = $ response ;
210210 }
211211 self ::assertInstanceOf (Response::class, $ responses [1 ]);
@@ -225,7 +225,7 @@ public function testResponseErrorToString() : void
225225 $ requests = [
226226 new Request ('https://aplus-framework.tld ' ),
227227 ];
228- foreach ($ this ->client ->runMulti ($ requests ) as $ response ) {
228+ foreach ($ this ->client ->sendMulti ($ requests ) as $ response ) {
229229 self ::assertInstanceOf (ResponseError::class, $ response );
230230 self ::assertSame (
231231 'Error 6: Could not resolve host: aplus-framework.tld ' ,
0 commit comments