From d4dd7d01561d36329a77e52c4f3f6f762d3e6457 Mon Sep 17 00:00:00 2001 From: StephenGillCoop Date: Tue, 29 Aug 2023 19:44:45 +0100 Subject: [PATCH] Bug Fix --- src/GherkinProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GherkinProcessor.php b/src/GherkinProcessor.php index a7d6f35..5418e1e 100644 --- a/src/GherkinProcessor.php +++ b/src/GherkinProcessor.php @@ -186,7 +186,7 @@ private function checkForMissingSteps($scenarioObject, array $testFileStepsArray // But check if has $data and update it accordingly? (Just like datasets and description) $stepArguments = $scenarioStepObject->getArguments(); - if($stepArguments[0] instanceof TableNode) { + if(array_key_exists(0, $stepArguments) && $stepArguments[0] instanceof TableNode) { $r = $this->removeExistingDataFromStep($y, $editedTestFileLines); $stepArgumentsData = $this->pestCreator->writeStepArgumentTable($stepArguments); @@ -202,7 +202,7 @@ private function checkForMissingSteps($scenarioObject, array $testFileStepsArray $this->outputHandler->stepIsNotInTest($scenarioStepObject->getText(), $testFilename); $this->errors++; - $result = $this->pestCreator->writeStep($testFilename, $scenarioObject->getTitle(), $scenarioStepObject->getText()); + $result = $this->pestCreator->writeStep($testFilename, $scenarioObject->getTitle(), $scenarioStepObject->getText(), $scenarioStepObject->getArguments()); $tempAddition = array_merge($tempAddition, $result); }