You are here

protected function AdjustmentItemTest::setUp in Commerce Core 8.2

Overrides OrderKernelTestBase::setUp

File

modules/order/tests/src/Kernel/AdjustmentItemTest.php, line 28

Class

AdjustmentItemTest
Tests the adjustment field.

Namespace

Drupal\Tests\commerce_order\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $field_storage = FieldStorageConfig::create([
    'field_name' => 'test_adjustments',
    'entity_type' => 'entity_test',
    'type' => 'commerce_adjustment',
    'cardinality' => FieldStorageConfig::CARDINALITY_UNLIMITED,
  ]);
  $field_storage
    ->save();
  $field = FieldConfig::create([
    'field_name' => 'test_adjustments',
    'entity_type' => 'entity_test',
    'bundle' => 'entity_test',
  ]);
  $field
    ->save();
  $entity = EntityTest::create([
    'name' => 'Test',
  ]);
  $entity
    ->save();
  $this->testEntity = $entity;
}