You are here

protected function OrderItemMatcherTest::setUp in Commerce Core 8.2

Overrides CartKernelTestBase::setUp

File

modules/cart/tests/src/Kernel/OrderItemMatcherTest.php, line 50

Class

OrderItemMatcherTest
Tests the order item matcher.

Namespace

Drupal\Tests\commerce_cart\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installConfig([
    'extra_order_item_field',
  ]);
  $this->variation1 = ProductVariation::create([
    'type' => 'default',
    'sku' => strtolower($this
      ->randomMachineName()),
    'title' => $this
      ->randomString(),
    'price' => new Price('1.00', 'USD'),
    'status' => 1,
  ]);
  $this->variation2 = ProductVariation::create([
    'type' => 'default',
    'sku' => strtolower($this
      ->randomMachineName()),
    'title' => $this
      ->randomString(),
    'price' => new Price('2.00', 'USD'),
    'status' => 1,
  ]);
  $this->orderItemMatcher = $this->container
    ->get('commerce_cart.order_item_matcher');
}