File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
src/Magento/FunctionalTestingFramework/DataGenerator/Persist Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments