You are here

public function CartProviderTest::testFinalizeCart in Commerce Core 8.2

Tests finalizing a cart.

@covers ::finalizeCart

File

modules/cart/tests/src/Kernel/CartProviderTest.php, line 158

Class

CartProviderTest
Tests the cart provider.

Namespace

Drupal\Tests\commerce_cart\Kernel

Code

public function testFinalizeCart() {
  $cart = $this->cartProvider
    ->createCart('default', $this->store, $this->authenticatedUser);
  $this->cartProvider
    ->finalizeCart($cart);
  $cart = $this
    ->reloadEntity($cart);
  $this
    ->assertEmpty($cart->cart->value);
  $cart = $this->cartProvider
    ->getCart('default', $this->store, $this->authenticatedUser);
  $this
    ->assertNull($cart);
}