You are here

protected function PriceSplitterTest::setUp in Commerce Core 8.2

Overrides OrderKernelTestBase::setUp

File

modules/order/tests/src/Kernel/PriceSplitterTest.php, line 35

Class

PriceSplitterTest
Tests the price splitter.

Namespace

Drupal\Tests\commerce_order\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $user = $this
    ->createUser([
    'mail' => $this
      ->randomString() . '@example.com',
  ]);
  $order = Order::create([
    'type' => 'default',
    'state' => 'draft',
    'mail' => $user
      ->getEmail(),
    'uid' => $user
      ->id(),
    'ip_address' => '127.0.0.1',
    'order_number' => '6',
    'store_id' => $this->store
      ->id(),
  ]);
  $order
    ->save();
  $this->order = $this
    ->reloadEntity($order);
  $this->splitter = $this->container
    ->get('commerce_order.price_splitter');
}