We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9fa0393 commit 029ec01Copy full SHA for 029ec01
1 file changed
tests/ReCaptcha/RequestMethod/SocketPostTest.php
@@ -269,4 +269,19 @@ public function testBadResponseReturnsErrorWhenHttp11(): void
269
270
$this->assertEquals('{"success": false, "error-codes": ["'.ReCaptcha::E_BAD_RESPONSE.'"]}', $response);
271
}
272
+
273
+ public function testBadResponseReturnsErrorWhenHttp2(): void
274
+ {
275
+ SocketPostGlobalState::$fgetsResponses = [
276
+ "HTTP/2.0 200 OK\r\n",
277
+ "Content-Type: application/json\r\n",
278
+ "\r\n",
279
+ 'RESPONSEBODY',
280
+ ];
281
282
+ $sp = new SocketPost();
283
+ $response = $sp->submit(new RequestParameters('secret', 'response'));
284
285
+ $this->assertEquals('{"success": false, "error-codes": ["'.ReCaptcha::E_BAD_RESPONSE.'"]}', $response);
286
+ }
287
0 commit comments