You are here

protected function CheckoutOrderTest::setUp in Commerce Core 8.2

Overrides CommerceBrowserTestBase::setUp

File

modules/checkout/tests/src/Functional/CheckoutOrderTest.php, line 66

Class

CheckoutOrderTest
Tests the checkout of an order.

Namespace

Drupal\Tests\commerce_checkout\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->placeBlock('commerce_cart');
  $this
    ->placeBlock('commerce_checkout_progress');
  $variation = $this
    ->createEntity('commerce_product_variation', [
    'type' => 'default',
    'sku' => strtolower($this
      ->randomMachineName()),
    'price' => [
      'number' => 9.99,
      'currency_code' => 'USD',
    ],
  ]);

  /** @var \Drupal\commerce_product\Entity\ProductInterface $product */
  $this->product = $this
    ->createEntity('commerce_product', [
    'type' => 'default',
    'title' => 'My product',
    'variations' => [
      $variation,
    ],
    'stores' => [
      $this->store,
    ],
  ]);
}