|
415 | 415 | MockResponse::make(['foo' => 'bar'], 200, ['Content-Type' => 'application/json']), |
416 | 416 | // JSON with charset |
417 | 417 | MockResponse::make(['foo' => 'bar'], 200, ['Content-Type' => 'application/json; charset=utf-8']), |
| 418 | + // JSON with lowercase header (e.g. FastAPI, HTTP/2) |
| 419 | + MockResponse::make(['foo' => 'bar'], 200, ['content-type' => 'application/json']), |
418 | 420 | // Non-JSON content type |
419 | 421 | MockResponse::make('plain text', 200, ['Content-Type' => 'text/plain']), |
420 | 422 | // No content type |
|
429 | 431 | $response = $connector->send(new UserRequest, $mockClient); |
430 | 432 | expect($response->isJson())->toBeTrue(); |
431 | 433 |
|
| 434 | + $response = $connector->send(new UserRequest, $mockClient); |
| 435 | + expect($response->isJson())->toBeTrue(); |
| 436 | + |
432 | 437 | $response = $connector->send(new UserRequest, $mockClient); |
433 | 438 | expect($response->isJson())->toBeFalse(); |
434 | 439 |
|
|
442 | 447 | MockResponse::make('<?xml version="1.0"?><root></root>', 200, ['Content-Type' => 'application/xml']), |
443 | 448 | // XML with charset |
444 | 449 | MockResponse::make('<?xml version="1.0"?><root></root>', 200, ['Content-Type' => 'text/xml; charset=utf-8']), |
| 450 | + // XML with lowercase header (e.g. FastAPI, HTTP/2) |
| 451 | + MockResponse::make('<?xml version="1.0"?><root></root>', 200, ['content-type' => 'application/xml']), |
445 | 452 | // Non-XML content type |
446 | 453 | MockResponse::make('plain text', 200, ['Content-Type' => 'text/plain']), |
447 | 454 | // No content type |
|
456 | 463 | $response = $connector->send(new UserRequest, $mockClient); |
457 | 464 | expect($response->isXml())->toBeTrue(); |
458 | 465 |
|
| 466 | + $response = $connector->send(new UserRequest, $mockClient); |
| 467 | + expect($response->isXml())->toBeTrue(); |
| 468 | + |
459 | 469 | $response = $connector->send(new UserRequest, $mockClient); |
460 | 470 | expect($response->isXml())->toBeFalse(); |
461 | 471 |
|
|
0 commit comments