File tree Expand file tree Collapse file tree 7 files changed +15
-8
lines changed
src/Magento/FunctionalTestingFramework Expand file tree Collapse file tree 7 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \FunctionalTestingFramework \Config ;
8
8
9
+ use Magento \FunctionalTestingFramework \Config \Dom \ValidationException ;
10
+
9
11
/**
10
12
* Magento configuration XML DOM utility
11
13
*/
@@ -354,13 +356,18 @@ public function getDom()
354
356
* Create DOM document based on $xml parameter
355
357
*
356
358
* @param string $xml
359
+ * @param string $filename
357
360
* @return \DOMDocument
358
361
* @throws \Magento\FunctionalTestingFramework\Config\Dom\ValidationException
359
362
*/
360
- protected function initDom ($ xml )
363
+ protected function initDom ($ xml, $ filename = null )
361
364
{
362
365
$ dom = new \DOMDocument ();
363
- $ dom ->loadXML ($ xml );
366
+ try {
367
+ $ dom ->loadXML ($ xml );
368
+ } catch (\Exception $ exception ) {
369
+ throw new ValidationException ($ filename . "\n" );
370
+ }
364
371
if ($ this ->schemaFile ) {
365
372
$ errors = self ::validateDomDocument ($ dom , $ this ->schemaFile , $ this ->errorFormat );
366
373
if (count ($ errors )) {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public function __construct(
65
65
*/
66
66
public function initDom ($ xml , $ filename = null )
67
67
{
68
- $ dom = parent ::initDom ($ xml );
68
+ $ dom = parent ::initDom ($ xml, $ filename );
69
69
70
70
if (strpos ($ filename , self ::DATA_FILE_NAME_ENDING )) {
71
71
$ entityNodes = $ dom ->getElementsByTagName ('entity ' );
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public function __construct(
65
65
*/
66
66
public function initDom ($ xml , $ filename = null )
67
67
{
68
- $ dom = parent ::initDom ($ xml );
68
+ $ dom = parent ::initDom ($ xml, $ filename );
69
69
70
70
if (strpos ($ filename , self ::METADATA_FILE_NAME_ENDING )) {
71
71
$ operationNodes = $ dom ->getElementsByTagName ('operation ' );
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public function __construct(
76
76
*/
77
77
public function initDom ($ xml , $ filename = null )
78
78
{
79
- $ dom = parent ::initDom ($ xml );
79
+ $ dom = parent ::initDom ($ xml, $ filename );
80
80
81
81
$ pagesNode = $ dom ->getElementsByTagName ('pages ' )->item (0 );
82
82
$ this ->validationUtil ->validateChildUniqueness ($ pagesNode , $ filename );
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function __construct(
67
67
*/
68
68
public function initDom ($ xml , $ filename = null )
69
69
{
70
- $ dom = parent ::initDom ($ xml );
70
+ $ dom = parent ::initDom ($ xml, $ filename );
71
71
$ sectionNodes = $ dom ->getElementsByTagName ('section ' );
72
72
foreach ($ sectionNodes as $ sectionNode ) {
73
73
$ sectionNode ->setAttribute (self ::SECTION_META_FILENAME_ATTRIBUTE , $ filename );
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class ActionGroupDom extends Dom
26
26
*/
27
27
public function initDom ($ xml , $ filename = null )
28
28
{
29
- $ dom = parent ::initDom ($ xml );
29
+ $ dom = parent ::initDom ($ xml, $ filename );
30
30
31
31
if (strpos ($ filename , self ::ACTION_GROUP_FILE_NAME_ENDING )) {
32
32
$ actionGroupNodes = $ dom ->getElementsByTagName ('actionGroup ' );
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function __construct(
79
79
*/
80
80
public function initDom ($ xml , $ filename = null )
81
81
{
82
- $ dom = parent ::initDom ($ xml );
82
+ $ dom = parent ::initDom ($ xml, $ filename );
83
83
84
84
if (strpos ($ filename , self ::TEST_FILE_NAME_ENDING )) {
85
85
$ testNodes = $ dom ->getElementsByTagName ('test ' );
You can’t perform that action at this time.
0 commit comments