File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
dev/tests/unit/Magento/FunctionalTestFramework/Test/Config
src/Magento/FunctionalTestingFramework/Config Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 6
6
namespace Tests \unit \Magento \FunctionalTestFramework \Test \Config ;
7
7
8
8
use Magento \FunctionalTestingFramework \Exceptions \Collector \ExceptionCollector ;
9
+ use Magento \FunctionalTestingFramework \Config \Dom \ValidationException ;
9
10
use Magento \FunctionalTestingFramework \Test \Config \ActionGroupDom ;
10
11
use Magento \FunctionalTestingFramework \Util \MagentoTestCase ;
11
12
@@ -29,4 +30,20 @@ public function testActionGroupDomStepKeyValidation()
29
30
$ this ->expectException (\Exception::class);
30
31
$ exceptionCollector ->throwException ();
31
32
}
33
+
34
+ /**
35
+ * Test Action Group invalid XML
36
+ */
37
+ public function testActionGroupDomInvalidXmlValidation ()
38
+ {
39
+ $ sampleXml = "<actionGroups>
40
+ <actionGroup name= \"actionGroupWithoutArguments \">
41
+ <wait>
42
+ </actionGroup>
43
+ </actionGroups> " ;
44
+
45
+ $ exceptionCollector = new ExceptionCollector ();
46
+ $ this ->expectException (ValidationException::class);
47
+ new ActionGroupDom ($ sampleXml , 'bad.xml ' , $ exceptionCollector );
48
+ }
32
49
}
Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ protected function initDom($xml, $filename = null)
366
366
try {
367
367
$ dom ->loadXML ($ xml );
368
368
} catch (\Exception $ exception ) {
369
- throw new ValidationException ($ filename . " \n" );
369
+ throw new ValidationException (" XML Parse Error: $ filename \n" );
370
370
}
371
371
if ($ this ->schemaFile ) {
372
372
$ errors = self ::validateDomDocument ($ dom , $ this ->schemaFile , $ this ->errorFormat );
You can’t perform that action at this time.
0 commit comments