improve export filename (#2958)

This commit is contained in:
Kevin Papst
2021-11-19 18:53:43 +01:00
committed by GitHub
parent 56d02673ed
commit 859131308a
10 changed files with 199 additions and 10 deletions

View File

@@ -36,8 +36,9 @@ class XlsxRendererTest extends AbstractRendererTest
$response = $this->render($sut);
$file = $response->getFile();
$prefix = date('Ymd');
$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->assertEquals('attachment; filename=' . $prefix . '-Customer_Name-project_name.xlsx', $response->headers->get('Content-Disposition'));
$this->assertTrue(file_exists($file->getRealPath()));