OrderRollbackTest.php in Commerce Migrate 3.1.x
File
modules/ubercart/tests/src/Kernel/Migrate/uc6/OrderRollbackTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6;
use Drupal\commerce_order\Entity\OrderItem;
use Drupal\commerce_order\Entity\Order;
class OrderRollbackTest extends OrderTest {
protected static $modules = [
'commerce_price',
];
public function testOrder() {
parent::testOrder();
$this
->executeRollback('uc6_order');
$order_ids = [
1,
2,
];
foreach ($order_ids as $order_id) {
$order = Order::load($order_id);
$this
->assertNull($order, "Order {$order_id} exists.");
}
$order_item_ids = [
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.");
}
}
}