public function SimpleXmlTest::testReadBrokenXmlMissingTag in Migrate Plus 8.5
Same name and namespace in other branches
- 8.4 tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php \Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_parser\SimpleXmlTest::testReadBrokenXmlMissingTag()
Test reading broken XML (missing closing tag).
Throws
\Drupal\Migrate\MigrateException
File
- tests/
src/ Kernel/ Plugin/ migrate_plus/ data_parser/ SimpleXmlTest.php, line 130
Class
- SimpleXmlTest
- Test of the data_parser SimpleXml migrate_plus plugin.
Namespace
Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_parserCode
public function testReadBrokenXmlMissingTag() : void {
$url = $this->path . '/tests/data/simple_xml_broken_missing_tag.xml';
$this->configuration['urls'][0] = $url;
$this
->expectException(MigrateException::class);
// Newer versions of libxml mark it as an error 76, older ones as 73.
$this
->expectExceptionMessageMatches('/^Fatal Error 7[0-9]/');
$parser = $this->pluginManager
->createInstance('simple_xml', $this->configuration);
$parser
->next();
}