Skip to content

Commit f463ebd

Browse files
committed
The property of the parent element is used first when making a request
1 parent bf24553 commit f463ebd

File tree

1 file changed

+22
-4
lines changed
  • src/Magento/FunctionalTestingFramework/DataGenerator/Persist

1 file changed

+22
-4
lines changed

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php

+22-4
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,31 @@ private function resolveUrlReference($urlIn, $entityObjects)
200200

201201
if (!empty($matchedParams)) {
202202
foreach ($matchedParams[0] as $paramKey => $paramValue) {
203+
204+
$paramEntityParent = "";
205+
$matchedParent = [];
206+
$dataItem = $matchedParams[1][$paramKey];
207+
preg_match_all("/(.+?)\./", $dataItem, $matchedParent);
208+
209+
if (!empty($matchedParent) && !empty($matchedParent[0]))
210+
{
211+
$paramEntityParent = $matchedParent[1][0];
212+
$dataItem = preg_replace('/^'.$matchedParent[0][0].'/', '', $dataItem);
213+
}
214+
203215
foreach ($entityObjects as $entityObject) {
204-
$param = $entityObject->getDataByName(
205-
$matchedParams[1][$paramKey],
206-
EntityDataObject::CEST_UNIQUE_VALUE
207-
);
216+
217+
if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent)
218+
{
219+
$param = $entityObject->getDataByName(
220+
$dataItem,
221+
EntityDataObject::CEST_UNIQUE_VALUE
222+
);
223+
}
224+
208225
if (null !== $param) {
209226
$urlOut = str_replace($paramValue, $param, $urlOut);
227+
$param = null;
210228
continue;
211229
}
212230
}

0 commit comments

Comments
 (0)