/** * Constructor * * @param Filesystem $filesystem * @param Dom $converter * @param Parser $parser */ public function __construct(Filesystem $filesystem, Dom $converter, Parser $parser) { $this->filesystem = $filesystem; $this->converter = $converter; $this->parser = $parser; $this->parser->initErrorHandler(); }
/** * Constructor * * @param Dom $converter * @param Parser $parser * @param ComponentRegistrarInterface $moduleRegistry * @param DriverInterface $filesystemDriver */ public function __construct(Dom $converter, Parser $parser, ComponentRegistrarInterface $moduleRegistry, DriverInterface $filesystemDriver) { $this->converter = $converter; $this->parser = $parser; $this->parser->initErrorHandler(); $this->moduleRegistry = $moduleRegistry; $this->filesystemDriver = $filesystemDriver; }
/** * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage DOMDocument::loadXML(): Opening and ending tag mismatch */ public function testLoadXmlInvalid() { $sampleInvalidXml = '<?xml version="1.0"?><config></onfig>'; $this->parser->initErrorHandler(); $this->parser->loadXML($sampleInvalidXml); }