function QueryBatchTest::getPlugin

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/QueryBatchTest.php \Drupal\Tests\migrate\Kernel\QueryBatchTest::getPlugin()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/QueryBatchTest.php \Drupal\Tests\migrate\Kernel\QueryBatchTest::getPlugin()
  3. 11.x 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.

3 calls to QueryBatchTest::getPlugin()
QueryBatchTest::testBatchSizeNegative in core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
Tests a negative batch size throws an exception.
QueryBatchTest::testBatchSizeNonInteger in core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
Tests a non integer batch size throws an exception.
QueryBatchTest::testQueryBatch in core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
Tests query batch size.

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.