Skip to content

Commit 8b873a8

Browse files
authored
MQE-391: Variable is not correctly resolved when array symbol ([ or ]) is inside $$ signs
- Updated Regex for persisted variable replacement.
1 parent cef0e3a commit 8b873a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ private function resolveTestVariable($inputString, $quoteBreak = false)
772772
$replaced = false;
773773

774774
// Check for Cest-scope variables first, stricter regex match.
775-
preg_match_all("/\\$\\$[\w.]+\\$\\$/", $outputString, $matches);
775+
preg_match_all("/\\$\\$[\w.\[\]]+\\$\\$/", $outputString, $matches);
776776
foreach ($matches[0] as $match) {
777777
$replacement = null;
778778
$variable = $this->stripAndSplitReference($match, '$$');
@@ -791,7 +791,7 @@ private function resolveTestVariable($inputString, $quoteBreak = false)
791791
}
792792

793793
// Check Test-scope variables
794-
preg_match_all("/\\$[\w.]+\\$/", $outputString, $matches);
794+
preg_match_all("/\\$[\w.\[\]]+\\$/", $outputString, $matches);
795795
foreach ($matches[0] as $match) {
796796
$replacement = null;
797797
$variable = $this->stripAndSplitReference($match, '$');

0 commit comments

Comments
 (0)