OrderRollbackTest.php in Commerce Migrate 3.0.x
File
modules/commerce/tests/src/Kernel/Migrate/commerce1/OrderRollbackTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
use Drupal\commerce_order\Entity\OrderItem;
use Drupal\commerce_order\Entity\Order;
class OrderRollbackTest extends OrderTest {
public static $modules = [
'commerce_order',
'commerce_price',
'commerce_store',
];
public function testOrder() {
parent::testOrder();
$this
->executeRollback('commerce1_order');
$order_ids = [
1,
2,
3,
];
foreach ($order_ids as $order_id) {
$order = Order::load($order_id);
$this
->assertNull($order, "Order {$order_id} exists.");
}
$order_item_ids = [
1,
2,
3,
4,
];
foreach ($order_item_ids as $order_item_id) {
$order_item = OrderItem::load($order_item_id);
$this
->assertInstanceOf(OrderItem::class, $order_item, "Order item {$order_item_id} does not exist.");
}
}
}