File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Magento/FunctionalTestingFramework/Util Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -264,12 +264,16 @@ public function assembleTestPhp($testObject)
264
264
$ fileToArr = explode ("\n" , file_get_contents ($ testObject ->getFilename ()));
265
265
$ argArr = [];
266
266
foreach ($ fileToArr as $ key => $ fileVal ) {
267
- if (strpos ($ fileVal , "<argument name " ) == true ) {
267
+ if (! empty ( strpos ($ fileVal , "<argument name " )) ) {
268
268
$ argArr [$ key ] = explode (" " , trim ($ fileVal ))[1 ];
269
269
}
270
270
}
271
271
foreach ($ argArr as $ key => $ arrVal ) {
272
- if (@$ argArr [$ key + 1 ] == $ arrVal || @$ argArr [$ key - 1 ] == $ arrVal ) {
272
+ if (!empty ($ argArr [$ key + 1 ]) && $ argArr [$ key + 1 ] === $ arrVal ) {
273
+ $ err [] = 'Duplicate argument name ' .$ arrVal .' not allowed in helper or actionGroup ' ;
274
+ throw new TestFrameworkException (implode (PHP_EOL , $ err ));
275
+ }
276
+ if (!empty ($ argArr [$ key - 1 ]) && $ argArr [$ key - 1 ] === $ arrVal ) {
273
277
$ err [] = 'Duplicate argument name ' .$ arrVal .' not allowed in helper or actionGroup ' ;
274
278
throw new TestFrameworkException (implode (PHP_EOL , $ err ));
275
279
}
You can’t perform that action at this time.
0 commit comments