You are here

protected function ProductMultilingualTest::setUp in Commerce Core 8.2

Overrides CommerceKernelTestBase::setUp

File

modules/product/tests/src/Kernel/ProductMultilingualTest.php, line 35

Class

ProductMultilingualTest
Tests the product and variation entity in a multilingual context.

Namespace

Drupal\Tests\commerce_product\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('commerce_product');
  $this
    ->installEntitySchema('commerce_product_variation');
  $this
    ->installEntitySchema('commerce_product_attribute_value');
  $this
    ->installConfig([
    'commerce_product',
  ]);
  ConfigurableLanguage::createFromLangcode('fr')
    ->save();
  ConfigurableLanguage::createFromLangcode('sr')
    ->save();
  $user = $this
    ->createUser([], [
    'administer commerce_product',
  ]);
  $this->container
    ->get('current_user')
    ->setAccount($user);
}