Skip to content

Commit 6aaa2f0

Browse files
committed
Merge remote-tracking branch 'origin/develop' into MQE-2016
2 parents 29fa7fa + bedde57 commit 6aaa2f0

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Test/Objects/ActionObjectTest.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ public function testResolveUrl()
233233
*/
234234
public function testResolveUrlWithNoAttribute()
235235
{
236+
$this->expectException(TestReferenceException::class);
237+
236238
// Set up mocks
237239
$actionObject = new ActionObject('merge123', 'amOnPage', [
238240
'url' => '{{PageObject}}'
@@ -247,19 +249,6 @@ public function testResolveUrlWithNoAttribute()
247249

248250
// Call the method under test
249251
$actionObject->resolveReferences();
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-
);
257-
258-
// Verify
259-
$expected = [
260-
'url' => '{{PageObject}}'
261-
];
262-
$this->assertEquals($expected, $actionObject->getCustomActionAttributes());
263252
}
264253

265254
/**

src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ private function __construct()
7272

7373
$module = $pageData[self::MODULE] ?? null;
7474
$sectionNames = array_keys($pageData[self::SECTION] ?? []);
75-
$parameterized = $pageData[self::PARAMETERIZED] ?? false;
75+
$urlContainsMustaches = strpos($url, "{{") !== false && strpos($url, "}}") !== false;
76+
$parameterized = $pageData[self::PARAMETERIZED] ?? $urlContainsMustaches ?? false;
77+
$filename = $pageData[self::FILENAME] ?? null;
7678
$deprecated = $pageData[self::OBJ_DEPRECATED] ?? null;
7779

7880
if ($deprecated !== null) {

src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ private function resolveUrlReference()
420420
$allPages = PageObjectHandler::getInstance()->getAllObjects();
421421
if ($replacement === $url && array_key_exists(trim($url, "{}"), $allPages)
422422
) {
423-
LoggingUtil::getInstance()->getLogger(ActionObject::class)->warning(
423+
throw new TestReferenceException(
424424
"page url attribute not found and is required",
425425
["action" => $this->type, "url" => $url, "stepKey" => $this->stepKey]
426426
);

0 commit comments

Comments
 (0)