@@ -336,15 +336,15 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
336
336
if (isset ($ customActionAttributes ['selectorArray ' ])) {
337
337
$ selector = $ customActionAttributes ['selectorArray ' ];
338
338
} elseif (isset ($ customActionAttributes ['selector ' ])) {
339
- $ selector = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['selector ' ]);
339
+ $ selector = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['selector ' ]);
340
340
}
341
341
342
342
if (isset ($ customActionAttributes ['selector1 ' ])) {
343
- $ selector1 = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['selector1 ' ]);
343
+ $ selector1 = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['selector1 ' ]);
344
344
}
345
345
346
346
if (isset ($ customActionAttributes ['selector2 ' ])) {
347
- $ selector2 = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['selector2 ' ]);
347
+ $ selector2 = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['selector2 ' ]);
348
348
}
349
349
350
350
if (isset ($ customActionAttributes ['x ' ])) {
@@ -364,15 +364,15 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
364
364
}
365
365
366
366
if (isset ($ customActionAttributes ['locale ' ])) {
367
- $ locale = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['locale ' ]);
367
+ $ locale = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['locale ' ]);
368
368
}
369
369
370
370
if (isset ($ customActionAttributes ['username ' ])) {
371
- $ username = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['username ' ]);
371
+ $ username = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['username ' ]);
372
372
}
373
373
374
374
if (isset ($ customActionAttributes ['password ' ])) {
375
- $ password = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['password ' ]);
375
+ $ password = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['password ' ]);
376
376
}
377
377
378
378
if (isset ($ customActionAttributes ['width ' ])) {
@@ -384,15 +384,15 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
384
384
}
385
385
386
386
if (isset ($ customActionAttributes ['value ' ])) {
387
- $ value = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['value ' ]);
387
+ $ value = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['value ' ]);
388
388
}
389
389
390
390
if (isset ($ customActionAttributes ['button ' ])) {
391
- $ button = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['button ' ]);
391
+ $ button = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['button ' ]);
392
392
}
393
393
394
394
if (isset ($ customActionAttributes ['parameter ' ])) {
395
- $ parameter = $ this ->wrapWithSingleQuotes ($ customActionAttributes ['parameter ' ]);
395
+ $ parameter = $ this ->wrapWithDoubleQuotes ($ customActionAttributes ['parameter ' ]);
396
396
}
397
397
398
398
switch ($ actionName ) {
@@ -584,7 +584,7 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
584
584
$ testSteps .= $ this ->wrapFunctionCall ($ actor , $ actionName , $ function );
585
585
break ;
586
586
case "executeJS " :
587
- $ testSteps .= $ this ->wrapFunctionCall ($ actor , $ actionName , $ this ->wrapWithSingleQuotes ($ function ));
587
+ $ testSteps .= $ this ->wrapFunctionCall ($ actor , $ actionName , $ this ->wrapWithDoubleQuotes ($ function ));
588
588
break ;
589
589
case "performOn " :
590
590
case "waitForElementChange " :
@@ -594,7 +594,7 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
594
594
$ testSteps .= $ this ->wrapFunctionCall (
595
595
$ actor ,
596
596
$ actionName ,
597
- $ this ->wrapWithSingleQuotes ($ function ),
597
+ $ this ->wrapWithDoubleQuotes ($ function ),
598
598
$ time
599
599
);
600
600
break ;
@@ -972,26 +972,26 @@ private function addUniquenessFunctionCall($input)
972
972
$ parts [$ i ] = $ this ->stripWrappedQuotes ($ parts [$ i ]);
973
973
}
974
974
if (!empty ($ parts [0 ])) {
975
- $ output = $ this ->wrapWithSingleQuotes ($ parts [0 ]);
975
+ $ output = $ this ->wrapWithDoubleQuotes ($ parts [0 ]);
976
976
}
977
977
$ output .= $ output === '' ? $ matches [0 ] : '. ' . $ matches [0 ];
978
978
if (!empty ($ parts [1 ])) {
979
- $ output .= '. ' . $ this ->wrapWithSingleQuotes ($ parts [1 ]);
979
+ $ output .= '. ' . $ this ->wrapWithDoubleQuotes ($ parts [1 ]);
980
980
}
981
981
} else {
982
- $ output = $ this ->wrapWithSingleQuotes ($ input );
982
+ $ output = $ this ->wrapWithDoubleQuotes ($ input );
983
983
}
984
984
985
985
return $ output ;
986
986
}
987
987
988
988
/**
989
- * Wrap input string with single quotes.
989
+ * Wrap input string with double quotes, and replaces " with \" to prevent broken PHP when generated .
990
990
*
991
991
* @param string $input
992
992
* @return string
993
993
*/
994
- private function wrapWithSingleQuotes ($ input )
994
+ private function wrapWithDoubleQuotes ($ input )
995
995
{
996
996
if (empty ($ input )) {
997
997
return '' ;
0 commit comments