You are here

protected function PromotionTest::setUp in Commerce Core 8.2

Same name in this branch
  1. 8.2 modules/promotion/tests/src/FunctionalJavascript/PromotionTest.php \Drupal\Tests\commerce_promotion\FunctionalJavascript\PromotionTest::setUp()
  2. 8.2 modules/promotion/tests/src/Kernel/Entity/PromotionTest.php \Drupal\Tests\commerce_promotion\Kernel\Entity\PromotionTest::setUp()

Overrides CommerceWebDriverTestBase::setUp

File

modules/promotion/tests/src/FunctionalJavascript/PromotionTest.php, line 43

Class

PromotionTest
Tests the admin UI for promotions.

Namespace

Drupal\Tests\commerce_promotion\FunctionalJavascript

Code

protected function setUp() : void {
  parent::setUp();
  $variation = $this
    ->createEntity('commerce_product_variation', [
    'type' => 'default',
    'sku' => $this
      ->randomMachineName(),
    'price' => [
      'number' => 222,
      'currency_code' => 'USD',
    ],
  ]);
  $this->product = $this
    ->createEntity('commerce_product', [
    'type' => 'default',
    'title' => $this
      ->randomMachineName(),
    'stores' => [
      $this->store,
    ],
    'variations' => [
      $variation,
    ],
  ]);
  ConfigurableLanguage::createFromLangcode('fr')
    ->save();
}