public function testDeleteFileAfterSend() { $request = Request::
create('/'
);
$path = __DIR__.'/File/Fixtures/to_delete';
touch($path);
$realPath =
realpath($path);
$this->
assertFileExists($realPath);
$response =
new BinaryFileResponse($realPath, 200,
['Content-Type' => 'application/octet-stream'
]);
$response->
deleteFileAfterSend(true
);
$response->
prepare($request);
$response->
sendContent();
$this->
assertFileDoesNotExist($path);
} public function testAcceptRangeOnUnsafeMethods() { $request = Request::
create('/', 'POST'
);
$response =
new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif', 200,
['Content-Type' => 'application/octet-stream'
]);