function MigrationProcessTest::testGetProcess

Same name in this branch
  1. 11.x core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrationProcessTest::testGetProcess()
Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrationProcessTest::testGetProcess()
  2. 9 core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\MigrationProcessTest::testGetProcess()
  3. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrationProcessTest::testGetProcess()
  4. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\MigrationProcessTest::testGetProcess()
  5. 10 core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrationProcessTest::testGetProcess()
  6. 10 core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\MigrationProcessTest::testGetProcess()

Tests that calling getProcess() on a migration does not throw an exception.

Throws

\Exception

File

core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php, line 31

Class

MigrationProcessTest
Tests the getProcess() method of all Drupal 7 migrations.

Namespace

Drupal\Tests\migrate_drupal\Kernel\d7

Code

public function testGetProcess() : void {
    
    /** @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface $plugin_manager */
    $plugin_manager = $this->container
        ->get('plugin.manager.migration');
    $migrations = $plugin_manager->createInstancesByTag('Drupal 7');
    foreach ($migrations as $migration) {
        try {
            $process = $migration->getProcess();
        } catch (\Exception $e) {
            $this->fail(sprintf("Migration %s process failed with error: %s", $migration->label(), $e->getMessage()));
        }
        $this->assertNotNull($process);
    }
}

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