You are here

public function ProductRollbackTest::testProduct in Commerce Migrate 3.0.x

Same name in this branch
  1. 3.0.x modules/ubercart/tests/src/Kernel/Migrate/uc7/ProductRollbackTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7\ProductRollbackTest::testProduct()
  2. 3.0.x modules/ubercart/tests/src/Kernel/Migrate/uc6/ProductRollbackTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6\ProductRollbackTest::testProduct()
  3. 3.0.x modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductRollbackTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\ProductRollbackTest::testProduct()
Same name and namespace in other branches
  1. 8.2 modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductRollbackTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\ProductRollbackTest::testProduct()
  2. 3.1.x modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductRollbackTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\ProductRollbackTest::testProduct()

Test product migration rollback.

Overrides ProductTest::testProduct

File

modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductRollbackTest.php, line 18

Class

ProductRollbackTest
Tests rollback of Product migration.

Namespace

Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1

Code

public function testProduct() {
  $this
    ->executeRollbacks([
    'commerce1_product',
  ]);
  for ($id = 15; $id <= 34; $id++) {
    $product = Product::load($id);
    $this
      ->assertNull($product, "Product {$id} exists.");
  }
  for ($id = 1; $id <= 84; $id++) {
    $product_variation = ProductVariation::load($id);
    $this
      ->assertInstanceOf(ProductVariation::class, $product_variation, "Product variation {$id} exists.");
  }
}