You are here

public function SimpleXmlTest::testReadNonExistingXml in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php \Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_parser\SimpleXmlTest::testReadNonExistingXml()

Tests reading non-existing XML.

Throws

\Drupal\Migrate\MigrateException

File

tests/src/Kernel/Plugin/migrate_plus/data_parser/SimpleXmlTest.php, line 190

Class

SimpleXmlTest
Test of the data_parser SimpleXml migrate_plus plugin.

Namespace

Drupal\Tests\migrate_plus\Kernel\Plugin\migrate_plus\data_parser

Code

public function testReadNonExistingXml() {
  $url = $this->path . '/tests/data/simple_xml_non_existing.xml';
  $this->configuration['urls'][0] = $url;
  $this
    ->setExpectedException(MigrateException::class, 'file parser plugin: could not retrieve data from modules/contrib/migrate_plus/tests/data/simple_xml_non_existing.xml');
  $parser = $this->pluginManager
    ->createInstance('simple_xml', $this->configuration);
  $parser
    ->next();
}