From d74a027a186d62e6218b8e29328449d9b97e259f Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Tue, 4 May 2021 15:51:31 -0500 Subject: [PATCH] Explicitly check for valid input data (#231) 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. --- Classes/Core/Functional/FunctionalTestCase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/Core/Functional/FunctionalTestCase.php b/Classes/Core/Functional/FunctionalTestCase.php index f2210cbd..4c82786c 100644 --- a/Classes/Core/Functional/FunctionalTestCase.php +++ b/Classes/Core/Functional/FunctionalTestCase.php @@ -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, 'assertXmlStringEqualsXmlString((string)$value, (string)$record[$field]);