getAbstractRenderer(XlsxRenderer::class); $this->assertEquals('xlsx', $sut->getId()); $this->assertEquals('xlsx', $sut->getTitle()); $this->assertEquals('xlsx', $sut->getIcon()); } public function testRender() { $sut = $this->getAbstractRenderer(XlsxRenderer::class); /** @var BinaryFileResponse $response */ $response = $this->render($sut); $file = $response->getFile(); $this->assertEquals('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', $response->headers->get('Content-Type')); $this->assertEquals('attachment; filename=kimai-export.xlsx', $response->headers->get('Content-Disposition')); $this->assertTrue(file_exists($file->getRealPath())); ob_start(); $response->sendContent(); $content2 = ob_get_clean(); $this->assertNotEmpty($content2); $this->assertFalse(file_exists($file->getRealPath())); } }