mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Tests should not produce output - capture it
This commit is contained in:
@@ -14,8 +14,10 @@ class OutputTest extends TestCase {
|
||||
$csv = new Csv();
|
||||
$data = [0 => ['a', 'b', 'c'], 1 => ['d', 'e', 'f']];
|
||||
$fields = ['col1', 'col2', 'col3'];
|
||||
ob_start();
|
||||
$output = $csv->output('test.csv', $data, $fields, ',');
|
||||
$expected = "col1,col2,col3\ra,b,c\rd,e,f\r";
|
||||
self::assertEquals($expected, ob_get_clean());
|
||||
self::assertEquals($expected, $output);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user