You are here

public function PaymentFoundTest::testPaymentMigrationsFound in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 modules/ubercart/tests/src/Kernel/PaymentFoundTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\PaymentFoundTest::testPaymentMigrationsFound()
  2. 3.0.x modules/ubercart/tests/src/Kernel/PaymentFoundTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\PaymentFoundTest::testPaymentMigrationsFound()

Tests payment migration discovery when commerce_payment is installed.

File

modules/ubercart/tests/src/Kernel/PaymentFoundTest.php, line 38

Class

PaymentFoundTest
Tests that modules exist for all source and destination plugins.

Namespace

Drupal\Tests\commerce_migrate_ubercart\Kernel

Code

public function testPaymentMigrationsFound() {
  $this
    ->enableModules([
    'commerce_price',
    'commerce',
  ]);

  /** @var \Drupal\migrate\Plugin\MigrationPluginManager $plugin_manager */
  $plugin_manager = $this->container
    ->get('plugin.manager.migration');
  foreach ($this->paymentMigrations as $payment_migration) {
    $definition = $plugin_manager
      ->getDefinition($payment_migration);
    $migration = $plugin_manager
      ->createInstance($payment_migration, $definition);
    $this
      ->assertNotNull($migration, "Payment migration " . $payment_migration . " not found");
  }
}