You are here

public function CommerceCartTestCaseSimpleProduct::testCommerceCartRemove in Commerce Core 7

Test removing a product from the cart.

File

modules/cart/tests/commerce_cart.test, line 162
Functional tests for the commerce cart module.

Class

CommerceCartTestCaseSimpleProduct
Test cart features for a product display that only has one product attached.

Code

public function testCommerceCartRemove() {

  // Go to cart url.
  $this
    ->drupalGet($this
    ->getCommerceUrl('cart'));

  // Remove the product from the cart.
  $this
    ->drupalPost(NULL, array(), t('Remove'));

  // Test if the page resolves and there is something in the cart.
  $this
    ->assertText(t('Your shopping cart is empty.'), t('Removed product and cart is empty'));
}