You are here

protected function OrderBrowserTestBase::setUp in Commerce Core 8.2

Overrides CommerceBrowserTestBase::setUp

5 calls to OrderBrowserTestBase::setUp()
CartBrowserTestBase::setUp in modules/cart/tests/src/Functional/CartBrowserTestBase.php
CartTest::setUp in modules/cart/tests/src/Functional/CartTest.php
CustomerProfileTypeTest::setUp in modules/order/tests/src/Functional/CustomerProfileTypeTest.php
EmptyCartButtonTest::setUp in modules/cart/tests/src/Functional/EmptyCartButtonTest.php
OrderUserTest::setUp in modules/order/tests/src/Functional/OrderUserTest.php
5 methods override OrderBrowserTestBase::setUp()
CartBrowserTestBase::setUp in modules/cart/tests/src/Functional/CartBrowserTestBase.php
CartTest::setUp in modules/cart/tests/src/Functional/CartTest.php
CustomerProfileTypeTest::setUp in modules/order/tests/src/Functional/CustomerProfileTypeTest.php
EmptyCartButtonTest::setUp in modules/cart/tests/src/Functional/EmptyCartButtonTest.php
OrderUserTest::setUp in modules/order/tests/src/Functional/OrderUserTest.php

File

modules/order/tests/src/Functional/OrderBrowserTestBase.php, line 45

Class

OrderBrowserTestBase
Defines base class for commerce_order test cases.

Namespace

Drupal\Tests\commerce_order\Functional

Code

protected function setUp() : void {
  parent::setUp();

  // Create a product variation.
  $this->variation = $this
    ->createEntity('commerce_product_variation', [
    'type' => 'default',
    'sku' => $this
      ->randomMachineName(),
    'price' => [
      'number' => 999,
      'currency_code' => 'USD',
    ],
  ]);

  // We need a product too otherwise tests complain about the missing
  // backreference.
  $this
    ->createEntity('commerce_product', [
    'type' => 'default',
    'title' => $this
      ->randomMachineName(),
    'stores' => [
      $this->store,
    ],
    'variations' => [
      $this->variation,
    ],
  ]);
}