Assert the content type of the async handler works fine.

This commit is contained in:
Dave Smith-Hayes 2025-04-29 02:56:57 +00:00
parent 48e2b1fb18
commit 1e2c61291e

View File

@ -30,10 +30,12 @@ class AsyncHandlerTest extends TestCase
$response = $app->handle($request); $response = $app->handle($request);
$this->assertStringContainsString('<li>1</li>', $response->getBody()); $this->assertStringContainsString('<li>1</li>', $response->getBody());
$this->assertEquals("text/html", $response->getHeader('Content-Type')[0]);
$request = $this->createRequest('GET', '/test', [ 'Accept' => 'application/json']); $request = $this->createRequest('GET', '/test', [ 'Accept' => 'application/json']);
$response = $app->handle($request); $response = $app->handle($request);
$this->assertEquals('{"list":[1,2,3]}', $response->getBody()); $this->assertEquals('{"list":[1,2,3]}', $response->getBody());
$this->assertEquals("application/json", $response->getHeader('Content-Type')[0]);
} }
} }