OrderKernelTestBase.php in Commerce Core 8.2
File
modules/order/tests/src/Kernel/OrderKernelTestBase.php
View source
<?php
namespace Drupal\Tests\commerce_order\Kernel;
use Drupal\commerce_order\Comparator\AdjustmentComparator;
use Drupal\commerce_order\Entity\OrderItemType;
use Drupal\Tests\commerce\Kernel\CommerceKernelTestBase;
use SebastianBergmann\Comparator\Factory as PhpUnitComparatorFactory;
abstract class OrderKernelTestBase extends CommerceKernelTestBase {
public static $modules = [
'entity_reference_revisions',
'profile',
'state_machine',
'commerce_number_pattern',
'commerce_product',
'commerce_order',
];
protected function setUp() : void {
parent::setUp();
PhpUnitComparatorFactory::getInstance()
->register(new AdjustmentComparator());
$this
->installEntitySchema('profile');
$this
->installEntitySchema('commerce_order');
$this
->installEntitySchema('commerce_order_item');
$this
->installEntitySchema('commerce_product');
$this
->installEntitySchema('commerce_product_variation');
$this
->installConfig([
'commerce_product',
'commerce_order',
]);
$this
->installSchema('commerce_number_pattern', [
'commerce_number_pattern_sequence',
]);
OrderItemType::create([
'id' => 'test',
'label' => 'Test',
'orderType' => 'default',
])
->save();
}
}