function QueryBatchTest::getPlugin

Same name and namespace in other branches
  1. 11.x core/modules/migrate/tests/src/Kernel/QueryBatchTest.php \Drupal\Tests\migrate\Kernel\QueryBatchTest::getPlugin()
  2. 10 core/modules/migrate/tests/src/Kernel/QueryBatchTest.php \Drupal\Tests\migrate\Kernel\QueryBatchTest::getPlugin()

Instantiates the source plugin under test.

Parameters

array $configuration: The source plugin configuration.

Return value

\Drupal\migrate\Plugin\MigrateSourceInterface|object The fully configured source plugin.

File

core/modules/migrate/tests/src/Kernel/QueryBatchTest.php, line 209

Class

QueryBatchTest
Tests query batching.

Namespace

Drupal\Tests\migrate\Kernel

Code

protected function getPlugin($configuration) {
  /** @var \Drupal\migrate\Plugin\MigratePluginManager $plugin_manager */
  $plugin_manager = $this->container
    ->get('plugin.manager.migrate.source');
  $plugin = $plugin_manager->createInstance('query_batch_test', $configuration, $this->migration
    ->reveal());
  $this->migration
    ->getSourcePlugin()
    ->willReturn($plugin);
  return $plugin;
}

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