You are here

public function CommerceCheckoutTestProcess::testCommerceCheckoutPanesForm in Commerce Core 7

Test changing the weight and page of a pane.

File

modules/checkout/tests/commerce_checkout.test, line 88
Functional tests for the commerce checkout module.

Class

CommerceCheckoutTestProcess
Test checkout process.

Code

public function testCommerceCheckoutPanesForm() {

  // Log in as store customer.
  $this
    ->drupalLogin($this->store_customer);

  // Access to the config page for checkout forms
  $this
    ->drupalGet('admin/commerce/config/checkout/form');
  $this
    ->assertResponse(403, t('A normal user is not able to access to the checkout configuration form page.'));

  // Log in as store admin.
  $this
    ->drupalLogin($this->store_admin);

  // Access to the config page for checkout forms.
  $this
    ->drupalGet('admin/commerce/config/checkout/form');
  $this
    ->assertResponse(200, t('Store admin can access to the checkout configuration form page.'));

  // Modify weight of the panes
  $this
    ->drupalPost('admin/commerce/config/checkout/form', array(
    'panes[cart_contents][weight]' => 1,
  ), t('Save configuration'));
  $this
    ->assertOptionSelected('edit-panes-cart-contents-weight', 1, t('Pane weight changed'));

  // Change one pane to other page
  $this
    ->drupalPost('admin/commerce/config/checkout/form', array(
    'panes[checkout_review][page]' => 'disabled',
  ), t('Save configuration'));
  $this
    ->assertOptionSelected('edit-panes-checkout-review-page', 'disabled', t('Pane page changed'));
}