You are here

public function MigrationTest::testGetProcessPluginsExceptionMessage in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationTest::testGetProcessPluginsExceptionMessage()

Tests Migration::getProcessPlugins()

@covers ::getProcessPlugins

@dataProvider getProcessPluginsExceptionMessageProvider

Parameters

array $process: The migration process pipeline.

File

core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php, line 54

Class

MigrationTest
Tests the migration plugin.

Namespace

Drupal\Tests\migrate\Kernel\Plugin

Code

public function testGetProcessPluginsExceptionMessage(array $process) {

  // Test with an invalid process pipeline.
  $plugin_definition = [
    'id' => 'foo',
    'process' => $process,
  ];
  reset($process);
  $destination = key($process);
  $migration = \Drupal::service('plugin.manager.migration')
    ->createStubMigration($plugin_definition);
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage("Invalid process for destination '{$destination}' in migration 'foo'");
  $migration
    ->getProcessPlugins();
}