function MigrationTest::testGetProcessPluginsExceptionMessage

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationTest::testGetProcessPluginsExceptionMessage()
  2. 10 core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php \Drupal\Tests\migrate\Kernel\Plugin\MigrationTest::testGetProcessPluginsExceptionMessage()
  3. 11.x 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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.