Skip to content

Commit 95b1eec

Browse files
authored
MQE-1669: XML Comments outside of Test and AG
- Added check for node parent when converting XML comment to action
1 parent ba310f5 commit 95b1eec

File tree

1 file changed

+3
-1
lines changed
  • src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom

1 file changed

+3
-1
lines changed

src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Flat implements ConverterInterface
1818
const REMOVE_KEY_ATTRIBUTE = 'keyForRemoval';
1919
const EXTENDS_ATTRIBUTE = 'extends';
2020
const TEST_HOOKS = ['before', 'after'];
21+
const VALID_COMMENT_PARENT = ['test', 'before', 'after', 'actionGroup'];
2122

2223
/**
2324
* Array node configuration.
@@ -124,7 +125,8 @@ public function convertXml(\DOMNode $source, $basePath = '')
124125
) {
125126
$value = $node->nodeValue;
126127
break;
127-
} elseif ($node->nodeType == XML_COMMENT_NODE) {
128+
} elseif ($node->nodeType == XML_COMMENT_NODE &&
129+
in_array($node->parentNode->nodeName, self::VALID_COMMENT_PARENT)) {
128130
$uniqid = uniqid($node->nodeName);
129131
$value[$uniqid] = [
130132
'value' => trim($node->nodeValue),

0 commit comments

Comments
 (0)