Skip to content

Commit a9e04a7

Browse files
authored
Fix Element with no type attribute warnings
- Added ternary to $elementType assignment.
1 parent 40f2cf8 commit a9e04a7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Magento Functional Testing Framework Changelog
99

1010
### Fixes
1111
* Fixed an issue where mftf would fail to parse test materials for extensions installed under `vendor`.
12+
* Fixed an issue where an `element` with no `type` would cause PHP warnings during test runs.
1213

1314
2.3.9
1415
-----

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private function __construct()
6767
if (preg_match('/[^a-zA-Z0-9_]/', $elementName)) {
6868
throw new XmlException(sprintf(self::ELEMENT_NAME_ERROR_MSG, $elementName, $sectionName));
6969
}
70-
$elementType = $elementData[SectionObjectHandler::TYPE];
70+
$elementType = $elementData[SectionObjectHandler::TYPE] ?? null;
7171
$elementSelector = $elementData[SectionObjectHandler::SELECTOR] ?? null;
7272
$elementLocatorFunc = $elementData[SectionObjectHandler::LOCATOR_FUNCTION] ?? null;
7373
$elementTimeout = $elementData[SectionObjectHandler::TIMEOUT] ?? null;

0 commit comments

Comments
 (0)