You are here

protected function CommerceMigrateTestTrait::executeRollback in Commerce Migrate 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::executeRollback()
  2. 3.1.x tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::executeRollback()

Executes rollback on a single migration.

Parameters

string|\Drupal\migrate\Plugin\MigrationInterface $migration: The migration to rollback, or its ID.

3 calls to CommerceMigrateTestTrait::executeRollback()
OrderRollbackTest::testOrder in modules/ubercart/tests/src/Kernel/Migrate/uc6/OrderRollbackTest.php
Test rollback of order migration.
OrderRollbackTest::testOrder in modules/commerce/tests/src/Kernel/Migrate/commerce1/OrderRollbackTest.php
Test order migration from Drupal 7 to 8.
ProductRollbackTest::testProduct in modules/ubercart/tests/src/Kernel/Migrate/uc6/ProductRollbackTest.php
Test product migration rollback.

File

tests/src/Kernel/CommerceMigrateTestTrait.php, line 928

Class

CommerceMigrateTestTrait
Helper function to test migrations.

Namespace

Drupal\Tests\commerce_migrate\Kernel

Code

protected function executeRollback($migration) {
  if (is_string($migration)) {
    $this->migration = $this
      ->getMigration($migration);
  }
  else {
    $this->migration = $migration;
  }
  (new MigrateExecutable($this->migration, $this))
    ->rollback();
}