Skip to content

Commit eda4d0c

Browse files
authored
Update TestGenerator.php
1 parent 9afa1ab commit eda4d0c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,16 @@ public function throwExceptionIfDuplicateArgumentsFound(string $fileContents)
264264
$argArr[$key] = explode(" ", trim($fileVal))[1];
265265
}
266266
}
267-
267+
foreach ($argArr as $key => $arrVal) {
268+
if (!empty($argArr[$key + 1]) && $argArr[$key + 1] === $arrVal) {
269+
$err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup';
270+
throw new TestFrameworkException(implode(PHP_EOL, $err));
271+
}
272+
if (!empty($argArr[$key + 2]) && $argArr[$key + 2] === $arrVal) {
273+
$err[] = 'Duplicate argument name '.$arrVal.' not allowed in helper or actionGroup';
274+
throw new TestFrameworkException(implode(PHP_EOL, $err));
275+
}
276+
}
268277
}
269278

270279
/**

0 commit comments

Comments
 (0)