17 $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
22 $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
27 function ($configFile) {
28 $dom = new \DOMDocument();
30 $schema = $this->urnResolver->getRealPath(
31 'urn:magento:framework:DataObject/etc/fieldset_file.xsd' 36 'XML-file ' . $configFile .
' has validation errors:' . PHP_EOL . implode(
49 $xmlFile =
__DIR__ .
'/_files/fieldset.xml';
50 $dom = new \DOMDocument();
52 $schema = $this->urnResolver->getRealPath(
'urn:magento:framework:DataObject/etc/fieldset.xsd');
56 'There is a problem with the schema. A known good XML file failed validation: ' . PHP_EOL . implode(
67 $this->markTestSkipped(
'Skipped due to MAGETWO-45033');
69 $xmlFile =
__DIR__ .
'/_files/invalid_fieldset.xml';
70 $dom = new \DOMDocument();
72 $schema = $this->urnResolver->getRealPath(
'urn:magento:framework:DataObject/etc/fieldset.xsd');
75 $this->fail(
'There is a problem with the schema. A known bad XML file passed validation');
81 $xmlFile =
__DIR__ .
'/_files/fieldset_file.xml';
82 $dom = new \DOMDocument();
84 $schema = $this->urnResolver->getRealPath(
'urn:magento:framework:DataObject/etc/fieldset_file.xsd');
88 'There is a problem with the schema. A known good XML file failed validation: ' . PHP_EOL . implode(
99 $this->markTestSkipped(
'Skipped due to MAGETWO-45033');
101 $xmlFile =
__DIR__ .
'/_files/invalid_fieldset.xml';
102 $dom = new \DOMDocument();
104 $schema = $this->urnResolver->getRealPath(
'urn:magento:framework:DataObject/etc/fieldset_file.xsd');
107 $this->fail(
'There is a problem with the schema. A known bad XML file passed validation');
testSchemaUsingInvalidXml()
static validateDomDocument(\DOMDocument $dom, $schema, $errorFormat=self::ERROR_FORMAT_DEFAULT)
defined('TESTS_BP')||define('TESTS_BP' __DIR__
testFileSchemaUsingInvalidXml()
testFileSchemaUsingValidXml()
testSchemaUsingValidXml()