renderInline( '

{{ name }}

', [ 'name' => 'Dave' ] ); } }; $app = $this->getAppInstance(); $app->get('/test', $testController); $request = $this->createRequest('GET', '/test'); $response = $app->handle($request); $this->assertEquals('

Dave

', $response->getBody()); } public function testHtmlInlineResponseCodes(): void { $testController = new class extends Controller { public function respond(): Response { $response = $this->renderInline( '

{{ name }}

', [ 'name' => 'Oh no!' ] ); return $response->withStatus(400); } }; $app = $this->getAppInstance(); $app->get('/test', $testController); $request = $this->createRequest('GET', '/test'); $response = $app->handle($request); $this->assertEquals(400, $response->getStatusCode()); $this->assertEquals('

Oh no!

', $response->getBody()); $this->assertEquals('text/html', $response->getHeaderLine('Content-Type')); } }