Skip to content

Commit

Permalink
Merge pull request #161 from magento-gl/MQE-3228
Browse files Browse the repository at this point in the history
MQE-3228: Update MFTF to not pass NULL into non-nullable arguments
  • Loading branch information
KevinBKozan authored Feb 17, 2022
2 parents d8fdaaf + 27d5ee6 commit b299c31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct($name, $type, $selector, $locatorFunction, $timeout,
$this->type = $type;
$this->selector = $selector;
$this->locatorFunction = $locatorFunction;
if (strpos($locatorFunction, "Locator::") === false) {
if ($locatorFunction !== null && strpos($locatorFunction, "Locator::") === false) {
$this->locatorFunction = "Locator::" . $locatorFunction;
}
$this->timeout = $timeout;
Expand Down
22 changes: 11 additions & 11 deletions src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2140,18 +2140,18 @@ private function resolveRuntimeReference($args, $regex, $func)

foreach ($args as $key => $arg) {
$newArgs[$key] = $arg;
preg_match_all($regex, $arg, $matches);
if (!empty($matches[0])) {
foreach ($matches[0] as $matchKey => $fullMatch) {
$refVariable = $matches[1][$matchKey];

$replacement = $this->getReplacement($func, $refVariable);

$outputArg = $this->processQuoteBreaks($fullMatch, $newArgs[$key], $replacement);
$newArgs[$key] = $outputArg;
if ($arg !== null) {
preg_match_all($regex, $arg, $matches);
if (!empty($matches[0])) {
foreach ($matches[0] as $matchKey => $fullMatch) {
$refVariable = $matches[1][$matchKey];
$replacement = $this->getReplacement($func, $refVariable);
$outputArg = $this->processQuoteBreaks($fullMatch, $newArgs[$key], $replacement);
$newArgs[$key] = $outputArg;
}
unset($matches);
continue;
}
unset($matches);
continue;
}
}

Expand Down

0 comments on commit b299c31

Please sign in to comment.