You are here

public function CheckoutAccessTest::testOrderMustHaveItems in Commerce Core 8.2

Tests that an order must have items to enter checkout.

File

modules/checkout/tests/src/Kernel/CheckoutAccessTest.php, line 137

Class

CheckoutAccessTest
Tests the checkout access for orders.

Namespace

Drupal\Tests\commerce_checkout\Kernel

Code

public function testOrderMustHaveItems() {
  $user1 = $this
    ->createUser([], [
    'access checkout',
  ]);
  $order = $this
    ->createOrder($user1);
  $order
    ->setItems([]);
  $request = $this
    ->createRequest($order);
  $this
    ->assertFalse($this->accessManager
    ->checkRequest($request, $user1));
}