You are here

class MigrateToolsTestCommands in Migrate Tools 8.5

Same name and namespace in other branches
  1. 8.4 tests/modules/migrate_tools_test/src/Commands/MigrateToolsTestCommands.php \Drupal\migrate_tools_test\Commands\MigrateToolsTestCommands

Migrate Tools Test drush commands.

Hierarchy

Expanded class hierarchy of MigrateToolsTestCommands

1 string reference to 'MigrateToolsTestCommands'
drush.services.yml in tests/modules/migrate_tools_test/drush.services.yml
tests/modules/migrate_tools_test/drush.services.yml
1 service uses MigrateToolsTestCommands
migrate_tools_test.commands in tests/modules/migrate_tools_test/drush.services.yml
\Drupal\migrate_tools_test\Commands\MigrateToolsTestCommands

File

tests/modules/migrate_tools_test/src/Commands/MigrateToolsTestCommands.php, line 13

Namespace

Drupal\migrate_tools_test\Commands
View source
class MigrateToolsTestCommands extends DrushCommands {

  /**
   * Migration plugin manager service.
   *
   * @var \Drupal\migrate\Plugin\MigrationPluginManager
   */
  protected $migrationPluginManager;

  /**
   * MigrateToolsTestCommands constructor.
   *
   * @param \Drupal\migrate\Plugin\MigrationPluginManager $migrationPluginManager
   *   The Migration Plugin Manager.
   */
  public function __construct(MigrationPluginManager $migrationPluginManager) {
    parent::__construct();
    $this->migrationPluginManager = $migrationPluginManager;
  }

  /**
   * Run a batch import of fruit terms as a test.
   *
   * @command migrate:batch-import-fruit
   */
  public function batchImportFruit() {
    $fruit_migration = $this->migrationPluginManager
      ->createInstance('fruit_terms');
    $executable = new MigrateBatchExecutable($fruit_migration, new MigrateMessage());
    $executable
      ->batchImport();
    drush_backend_batch_process();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateToolsTestCommands::$migrationPluginManager protected property Migration plugin manager service.
MigrateToolsTestCommands::batchImportFruit public function Run a batch import of fruit terms as a test.
MigrateToolsTestCommands::__construct public function MigrateToolsTestCommands constructor.