sau khi suy nghĩ về chủ đề này mà không có kết quả, tôi hy vọng ai đó có thể cho tôi một gợi ý về phpUnit-Test để tải xuống. Làm thế nào tôi có thể tạo ra một thử nghiệm phpUnit cho chức năng này, mà thực hiện một tải về cho một Zip-File? Hay là có một thực hành bình thường để kiểm tra một logic như thế này?Làm thế nào để tạo một bài kiểm tra PHP-Unit để tải xuống tệp?
public function createOutput($zipFolderName) {
$zipFolderName = $zipFolderName."/imageResizer.zip";
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename=' . $zipFolderName);
header('Content-Length: ' . filesize($zipFolderName));
readfile($zipFolderName);
}