You are here

protected function OrderQueryAccessHandlerTest::setUp in Commerce Core 8.2

Overrides OrderKernelTestBase::setUp

File

modules/order/tests/src/Kernel/OrderQueryAccessHandlerTest.php, line 27

Class

OrderQueryAccessHandlerTest
Tests the order query access handler.

Namespace

Drupal\Tests\commerce_order\Kernel

Code

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

  // Create uid: 1 here so that it's skipped in test cases.
  $admin_user = $this
    ->createUser();
  $entity_type_manager = $this->container
    ->get('entity_type.manager');
  $entity_type = $entity_type_manager
    ->getDefinition('commerce_order');
  $this->handler = OrderQueryAccessHandler::createInstance($this->container, $entity_type);
  OrderType::create([
    'id' => 'first',
    'label' => 'First',
    'workflow' => 'order_default',
  ])
    ->save();
  OrderType::create([
    'id' => 'second',
    'label' => 'Second',
    'workflow' => 'order_default',
  ])
    ->save();
}