Skip to content

Commit

Permalink
Explicitly check for valid input data (#231)
Browse files Browse the repository at this point in the history
When comparing CSV data with DB rows, the method now throws a
ValueError exception if a column is defined in CSV but does not
exist in DB row.
  • Loading branch information
Crell committed May 4, 2021
1 parent dd3668c commit d74a027
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/Core/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ protected function getDifferentFields(array $assertion, array $record): array
continue;
}

if (!array_key_exists($field, $record)) {
throw new \ValueError(sprintf('"%s" column not found in the input data.', $field));
}

if (strpos($value, '<?xml') === 0) {
try {
$this->assertXmlStringEqualsXmlString((string)$value, (string)$record[$field]);
Expand Down

0 comments on commit d74a027

Please sign in to comment.