@@ -293,30 +293,6 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
293
293
$ button = null ;
294
294
$ parameter = null ;
295
295
296
- //Resolve $input$ and $$input$$ replacement in url, selector, and userInput.
297
- if (isset ($ customActionAttributes ['url ' ])) {
298
- $ customActionAttributes ['url ' ] = $ this ->resolveTestVariable (
299
- $ customActionAttributes ['url ' ],
300
- true
301
- );
302
- }
303
-
304
- if (isset ($ customActionAttributes ['userInput ' ])) {
305
- $ customActionAttributes ['userInput ' ] = $ this ->resolveTestVariable (
306
- $ customActionAttributes ['userInput ' ],
307
- true
308
- );
309
- }
310
-
311
- if (isset ($ customActionAttributes ['selector ' ])) {
312
- $ customActionAttributes ['selector ' ] = $ this ->resolveTestVariable (
313
- $ customActionAttributes ['selector ' ],
314
- true
315
- );
316
- }
317
-
318
- //Resume step building
319
-
320
296
if (isset ($ customActionAttributes ['returnVariable ' ])) {
321
297
$ returnVariable = $ customActionAttributes ['returnVariable ' ];
322
298
}
@@ -754,7 +730,7 @@ private function resolveTestVariable($inputString, $quoteBreak = false)
754
730
}
755
731
$ replacement = sprintf ("\$this->%s->getCreatedDataByName('%s') " , $ variable [0 ], $ variable [1 ]);
756
732
if ($ quoteBreak ) {
757
- $ replacement = " ' . " . $ replacement . " . ' " ;
733
+ $ replacement = ' " . ' . $ replacement . ' . " ' ;
758
734
}
759
735
$ outputString = str_replace ($ match , $ replacement , $ outputString );
760
736
$ replaced = true ;
@@ -773,7 +749,7 @@ private function resolveTestVariable($inputString, $quoteBreak = false)
773
749
}
774
750
$ replacement = sprintf ("$%s->getCreatedDataByName('%s') " , $ variable [0 ], $ variable [1 ]);
775
751
if ($ quoteBreak ) {
776
- $ replacement = " ' . " . $ replacement . " . ' " ;
752
+ $ replacement = ' " . ' . $ replacement . ' . " ' ;
777
753
}
778
754
$ outputString = str_replace ($ match , $ replacement , $ outputString );
779
755
$ replaced = true ;
@@ -1002,7 +978,8 @@ private function addUniquenessFunctionCall($input)
1002
978
*/
1003
979
private function wrapWithSingleQuotes ($ input )
1004
980
{
1005
- return sprintf ("'%s' " , $ input );
981
+ $ input = addslashes ($ input );
982
+ return sprintf ('"%s" ' , $ input );
1006
983
}
1007
984
1008
985
/**
@@ -1057,7 +1034,10 @@ private function wrapFunctionCall($actor, $action, ...$args)
1057
1034
$ isFirst = false ;
1058
1035
}
1059
1036
$ output .= "); \n" ;
1060
- return $ output ;
1037
+
1038
+ // TODO put in condiional to prevent unncessary quote break (i.e. there are no strings to be appended to
1039
+ // variable call.
1040
+ return $ this ->resolveTestVariable ($ output , true );
1061
1041
}
1062
1042
1063
1043
/**
@@ -1084,7 +1064,10 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio
1084
1064
$ isFirst = false ;
1085
1065
}
1086
1066
$ output .= "); \n" ;
1087
- return $ output ;
1067
+
1068
+ // TODO put in condiional to prevent unncessary quote break (i.e. there are no strings to be appended to
1069
+ // variable call.
1070
+ return $ output = $ this ->resolveTestVariable ($ output , true );
1088
1071
}
1089
1072
// @codingStandardsIgnoreEnd
1090
1073
}
0 commit comments