File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects
src/Magento/FunctionalTestingFramework/Test/Objects Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ public function testResolveUrl()
227
227
}
228
228
229
229
/**
230
- * {{PageObject}} should not be replaced and should elicit a warning in console
230
+ * {{PageObject}} should not be replaced and should throw an exception!
231
231
*
232
232
* @throws /Exception
233
233
*/
@@ -248,18 +248,9 @@ public function testResolveUrlWithNoAttribute()
248
248
// Call the method under test
249
249
$ actionObject ->resolveReferences ();
250
250
251
- // Expect this warning to get generated
252
- TestLoggingUtil::getInstance ()->validateMockLogStatement (
253
- "warning " ,
254
- "page url attribute not found and is required " ,
255
- ['action ' => $ actionObject ->getType (), 'url ' => '{{PageObject}} ' , 'stepKey ' => $ actionObject ->getStepKey ()]
256
- );
251
+ $ this ->expectExceptionMessage ('Can not resolve replacements: "{{PageObject}}" ' );
257
252
258
- // Verify
259
- $ expected = [
260
- 'url ' => '{{PageObject}} '
261
- ];
262
- $ this ->assertEquals ($ expected , $ actionObject ->getCustomActionAttributes ());
253
+ $ actionObject ->getCustomActionAttributes ();
263
254
}
264
255
265
256
/**
Original file line number Diff line number Diff line change @@ -428,15 +428,17 @@ private function resolveUrlReference()
428
428
/**
429
429
* Returns array of missing references
430
430
*
431
- * @param $replacement
431
+ * @param string $replacement
432
432
* @return array
433
433
*/
434
434
private function getMissingReferences ($ replacement ): array
435
435
{
436
436
$ mustachePattern = '/({{[\w]+}})|({{[\w]+\.[\w\[\]]+}})|({{[\w]+\.[\w]+\((?(?!}}).)+\)}})/ ' ;
437
437
preg_match_all ($ mustachePattern , $ replacement , $ matches );
438
438
439
- return array_filter ($ matches [1 ], function ($ match ) { return false === strpos ($ match , '_ENV. ' ); });
439
+ return array_filter ($ matches [1 ], function ($ match ) {
440
+ return false === strpos ($ match , '_ENV. ' );
441
+ });
440
442
}
441
443
442
444
/**
You can’t perform that action at this time.
0 commit comments