You are here

public function MigrationTest::testGetDestinationPlugin in Drupal 9

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

Tests Migration::getDestinationPlugin()

@covers ::getDestinationPlugin

File

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

Class

MigrationTest
Tests the migration plugin.

Namespace

Drupal\Tests\migrate\Kernel\Plugin

Code

public function testGetDestinationPlugin() {
  $migration = \Drupal::service('plugin.manager.migration')
    ->createStubMigration([
    'destination' => [
      'no_stub' => TRUE,
    ],
  ]);
  $this
    ->expectException(MigrateSkipRowException::class);
  $this
    ->expectExceptionMessage("Stub requested but not made because no_stub configuration is set.");
  $migration
    ->getDestinationPlugin(TRUE);
}