Fireguard\Report\Exporters\HtmlExporterTest::testCreateResponseForceDownload PHP Method

testCreateResponseForceDownload() public method

    public function testCreateResponseForceDownload()
    {
        $exporter = new HtmlExporter(null, 'test-file-name-download');
        $report = new Report('<section class="content">Content</section>');
        $response = $exporter->response($report, true);
        $this->assertInstanceOf(Response::class, $response);
        $this->assertTrue($response->headers->contains('content-disposition', 'attachment; filename="test-file-name-download.html"'), 'Could not find header to force download');
        $expectHtml = '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>' . $exporter->getFileName() . '</title></head><body style="background-color: #ffffff;"><section class="content">Content</section></body></html>';
        $this->assertEquals($expectHtml, $response->getContent());
    }