function UbercartCartCheckoutTestCase::testDeletedCartItem in Ubercart 6.2
Same name and namespace in other branches
- 7.3 uc_cart/tests/uc_cart.test \UbercartCartCheckoutTestCase::testDeletedCartItem()
File
- uc_cart/
uc_cart.test, line 176 - Shopping cart and checkout tests.
Class
- UbercartCartCheckoutTestCase
- Tests the cart and checkout functionality.
Code
function testDeletedCartItem() {
// Add a product to the cart, then delete the node.
$this
->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
node_delete($this->product->nid);
// Test that the cart is empty.
$this
->drupalGet('cart');
$this
->assertText('There are no products in your shopping cart.');
$this
->assertEqual(uc_cart_get_total_qty(), 0, 'There are no items in the cart.');
}