You are here

protected function ProductAttributeFieldManagerTest::setUp in Commerce Core 8.2

Overrides CommerceKernelTestBase::setUp

File

modules/product/tests/src/Kernel/ProductAttributeFieldManagerTest.php, line 38

Class

ProductAttributeFieldManagerTest
Tests the attribute field manager.

Namespace

Drupal\Tests\commerce_product\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('commerce_product_attribute');
  $this
    ->installEntitySchema('commerce_product_attribute_value');
  $this
    ->installEntitySchema('commerce_product_variation');
  $this
    ->installEntitySchema('commerce_product');
  $this->attributeFieldManager = $this->container
    ->get('commerce_product.attribute_field_manager');
  $first_variation_type = ProductVariationType::create([
    'id' => 'shirt',
    'label' => 'Shirt',
  ]);
  $first_variation_type
    ->save();
  $second_variation_type = ProductVariationType::create([
    'id' => 'mug',
    'label' => 'Mug',
  ]);
  $second_variation_type
    ->save();
}