You are here

protected function CartManagerTest::setUp in Commerce Core 8.2

Overrides CartKernelTestBase::setUp

File

modules/cart/tests/src/Kernel/CartManagerTest.php, line 52

Class

CartManagerTest
Tests the cart manager.

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,
  ]);
  $user = $this
    ->createUser();
  $this->user = $this
    ->reloadEntity($user);
}