File tree Expand file tree Collapse file tree
tests/unit/Codeception/Module Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 "ext-json" : " *" ,
2323 "codeception/codeception" : " *@dev" ,
2424 "codeception/lib-innerbrowser" : " *@dev" ,
25- "guzzlehttp/guzzle" : " ^7.4" ,
25+ "guzzlehttp/guzzle" : " ^7.8.2 | ^8.0" ,
26+ "guzzlehttp/psr7" : " ^2.6.3 | ^3.0" ,
2627 "symfony/browser-kit" : " ^5.4 | ^6.0 | ^7.0 | ^8.0"
2728 },
2829 "require-dev" : {
Original file line number Diff line number Diff line change @@ -209,11 +209,13 @@ protected function doRequest(object $request): object
209209 $ response = $ this ->client ->send ($ guzzleRequest , $ options );
210210 }
211211 } catch (RequestException $ exception ) {
212- if (!$ exception ->hasResponse ()) {
212+ // Guzzle 7 exposes the response on RequestException itself,
213+ // Guzzle 8 only on its ResponseException subclass.
214+ $ response = method_exists ($ exception , 'getResponse ' ) ? $ exception ->getResponse () : null ;
215+
216+ if ($ response === null ) {
213217 throw $ exception ;
214218 }
215-
216- $ response = $ exception ->getResponse ();
217219 }
218220
219221 // @phpstan-ignore-next-line
Original file line number Diff line number Diff line change 4444 * url: 'http://localhost' # Internationalized domain names (IDN) need to be passed in punycode
4545 * auth: ['admin', '123345']
4646 * curl:
47- * CURLOPT_RETURNTRANSFER : true
47+ * CURLOPT_TCP_KEEPALIVE : true
4848 * cookies:
4949 * cookie-1:
5050 * Name: userName
Original file line number Diff line number Diff line change @@ -397,7 +397,6 @@ public function testCurlSslOptions(): void
397397 $ this ->module ->_setConfig ([
398398 'url ' => 'https://github.com ' ,
399399 'curl ' => [
400- 'CURLOPT_NOBODY ' => true ,
401400 'CURLOPT_SSL_CIPHER_LIST ' => 'TLSv1 ' ,
402401 ]]);
403402 $ this ->module ->_initialize ();
@@ -407,7 +406,7 @@ public function testCurlSslOptions(): void
407406 $ this ->assertArrayHasKey ('curl ' , $ config );
408407 $ this ->assertArrayHasKey (CURLOPT_SSL_CIPHER_LIST , $ config ['curl ' ]);
409408 $ this ->module ->amOnPage ('/ ' );
410- $ this ->assertSame ( '' , $ this -> module ->_getResponseContent (), ' CURLOPT_NOBODY setting is not respected ' );
409+ $ this ->module ->seeResponseCodeIsSuccessful ( );
411410 }
412411
413412 public function testHttpAuth (): void
You can’t perform that action at this time.
0 commit comments