public function UbercartCartSettingsTestCase::testEmptyCart in Ubercart 7.3
File
- uc_cart/tests/uc_cart.test, line 720
- Shopping cart and checkout tests.
Class
- UbercartCartSettingsTestCase
- Tests the cart settings page.
Code
public function testEmptyCart() {
$this
->drupalPost('node/' . $this->product->nid, array(), 'Add to cart');
$this
->assertNoRaw('Empty cart');
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/store/settings/cart');
$this
->assertField('uc_cart_empty_button', 'Empty cart button checkbox found.');
$this
->drupalPost(NULL, array(
'uc_cart_empty_button' => TRUE,
), 'Save configuration');
$this
->drupalGet('cart');
$this
->drupalPost(NULL, array(), 'Empty cart');
$this
->assertText('Are you sure you want to empty your shopping cart? ');
$this
->drupalPost(NULL, array(), 'Confirm');
$this
->assertText('There are no products in your shopping cart.');
}