You are here

protected function CouponAvailableConstraintValidatorTest::setUp in Commerce Cart API 8

Overrides OrderKernelTestBase::setUp

File

tests/src/Kernel/CouponAvailableConstraintValidatorTest.php, line 34

Class

CouponAvailableConstraintValidatorTest
Tests the coupon available constraint on coupons fields.

Namespace

Drupal\Tests\commerce_cart_api\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('commerce_promotion');
  $this
    ->installEntitySchema('commerce_promotion_coupon');
  EntityFormMode::create([
    'id' => 'commerce_order_item.add_to_cart',
    'label' => 'Add to cart',
    'targetEntityType' => 'commerce_order_item',
  ])
    ->save();
  $this
    ->installSchema('commerce_promotion', [
    'commerce_promotion_usage',
  ]);
  $this
    ->installConfig([
    'commerce_promotion',
  ]);
}