Skip to content

Commit a60876b

Browse files
authored
add new assertion
Signed-off-by: rahul <rcsofttech85@gmail.com>
1 parent 9e54a18 commit a60876b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

bin/view-csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $command = (new SingleCommandApplication())
3333
$headers = $csvFileHandler->extractHeader($csvFile);
3434

3535
if (!$headers) {
36-
$io->error('could not extract headers');
36+
$io->error('invalid csv file');
3737
return Command::FAILURE;
3838
}
3939

tests/Integration/ViewCsvCommandTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public function throwExceptionIfFileIsInvalid(string $file): void
6868
{
6969
$command = "php bin/view-csv {$file}";
7070
exec($command, $output, $exitCode);
71+
$actualOutput = implode("\n", $output);
72+
73+
$this->assertStringContainsString('invalid csv file', $actualOutput);
7174
$this->assertSame(1, $exitCode);
7275
unlink($file);
7376
}

0 commit comments

Comments
 (0)