File tree 1 file changed +22
-4
lines changed
src/Magento/FunctionalTestingFramework/DataGenerator/Persist
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)
200
200
201
201
if (!empty ($ matchedParams )) {
202
202
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
+
203
215
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
+
208
225
if (null !== $ param ) {
209
226
$ urlOut = str_replace ($ paramValue , $ param , $ urlOut );
227
+ $ param = null ;
210
228
continue ;
211
229
}
212
230
}
You can’t perform that action at this time.
0 commit comments