You are here

function UbercartCheckoutSettingsTestCase::testEnableCheckout in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_cart/tests/uc_cart.test \UbercartCheckoutSettingsTestCase::testEnableCheckout()

File

uc_cart/uc_cart.test, line 577
Shopping cart and checkout tests.

Class

UbercartCheckoutSettingsTestCase
Tests the checkout settings page.

Code

function testEnableCheckout() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/store/settings/checkout/edit');
  $this
    ->assertField('uc_checkout_enabled', t('Enable checkout field exists'));
  $this
    ->drupalPost('admin/store/settings/checkout/edit', array(
    'uc_checkout_enabled' => FALSE,
  ), t('Save configuration'));
  $this
    ->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
  $this
    ->assertNoRaw(t('Checkout'));
  $buttons = $this
    ->xpath('//input[@value="' . t('Checkout') . '"]');
  $this
    ->assertFalse(isset($buttons[0]), t('The checkout button is not shown.'));
}