added unit tests

This commit is contained in:
2026-06-04 21:40:59 +02:00
parent d80a8de559
commit 48a619ee4b
64 changed files with 3807 additions and 33 deletions

View File

@ -365,12 +365,12 @@ function qdb_export_rows_to_csv_string(array $rows, array $fallbackHeader = []):
}
fwrite($fp, "\xEF\xBB\xBF");
if (!empty($rows)) {
fputcsv($fp, array_keys($rows[0]));
fputcsv($fp, array_keys($rows[0]), ',', '"', '\\');
foreach ($rows as $row) {
fputcsv($fp, array_values($row));
fputcsv($fp, array_values($row), ',', '"', '\\');
}
} elseif ($fallbackHeader !== []) {
fputcsv($fp, $fallbackHeader);
fputcsv($fp, $fallbackHeader, ',', '"', '\\');
}
rewind($fp);
$csv = stream_get_contents($fp);