public function testGetContent() { $response =
new BinaryFileResponse(__FILE__
);
$this->
assertFalse($response->
getContent());
} public function testSetContentDispositionGeneratesSafeFallbackFilename() { $response =
new BinaryFileResponse(__FILE__
);
$response->
setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'föö.html'
);
$this->
assertSame('attachment; filename=f__.html; filename*=utf-8\'\'f%C3%B6%C3%B6.html',
$response->headers->
get('Content-Disposition'
));
} public function testSetContentDispositionGeneratesSafeFallbackFilenameForWronglyEncodedFilename() { $response =
new BinaryFileResponse(__FILE__
);
$iso88591EncodedFilename =
mb_convert_encoding('föö.html', 'ISO-8859-1', 'UTF-8'
);
$response->
setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT,
$iso88591EncodedFilename);