You are here

public function OrderQueryAccessHandlerTest::testAdmin in Commerce Core 8.2

@covers ::getConditions

File

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

Class

OrderQueryAccessHandlerTest
Tests the order query access handler.

Namespace

Drupal\Tests\commerce_order\Kernel

Code

public function testAdmin() {
  foreach ([
    'view',
    'update',
    'delete',
  ] as $operation) {
    $user = $this
      ->createUser([], [
      'administer commerce_order',
    ]);
    $conditions = $this->handler
      ->getConditions($operation, $user);
    $this
      ->assertEquals(0, $conditions
      ->count());
    $this
      ->assertEquals([
      'user.permissions',
    ], $conditions
      ->getCacheContexts());
    $this
      ->assertFalse($conditions
      ->isAlwaysFalse());
  }
}