Skip to content

Commit ded92ff

Browse files
committed
MQE-1065: Persisted data are not resolved correctly when using with ParameterArray
- addressed review comments
1 parent 10c74aa commit ded92ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -1644,13 +1644,13 @@ private function processPressKey($input)
16441644
$arrayResult = [];
16451645
$count = 0;
16461646

1647-
// matches arrays
1647+
// matches all arrays and replaces them with placeholder to prevent later param manipulation
16481648
preg_match_all('/[\[][^\]]*?[\]]/', $input, $paramInput);
16491649
if (!empty($paramInput)) {
16501650
foreach ($paramInput[0] as $param) {
1651-
$arrayResult[static::PRESSKEY_ARRAY_ANCHOR_KEY . $count] =
1651+
$arrayResult[self::PRESSKEY_ARRAY_ANCHOR_KEY . $count] =
16521652
'[' . trim($this->addUniquenessToParamArray($param)) . ']';
1653-
$input = str_replace($param, static::PRESSKEY_ARRAY_ANCHOR_KEY . $count, $input);
1653+
$input = str_replace($param, self::PRESSKEY_ARRAY_ANCHOR_KEY . $count, $input);
16541654
$count++;
16551655
}
16561656
}
@@ -1681,6 +1681,7 @@ private function processPressKey($input)
16811681
}
16821682

16831683
$result = implode(',', $result);
1684+
// reinsert arrays into result
16841685
if (!empty($arrayResult)) {
16851686
foreach ($arrayResult as $key => $value) {
16861687
$result = str_replace($key, $value, $result);

0 commit comments

Comments
 (0)