You are here

public function UCXFCheckoutTestCase::testCheckout in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 6.2 uc_extra_fields_pane.test \UCXFCheckoutTestCase::testCheckout()

Test if checkout works as expected.

File

./uc_extra_fields_pane.test, line 771
Automated tests for Extra Fields Pane

Class

UCXFCheckoutTestCase
Checkout testcase

Code

public function testCheckout() {

  // Setup default fields.
  $this
    ->setupFields();

  // Test as anonymous user.
  $this
    ->drupalLogout();
  $this
    ->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
  $this
    ->checkout();
  $this
    ->assertRaw('Your order is complete!');

  // Test as authenticated user.
  $this
    ->drupalLogin($this->customer);
  $this
    ->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
  $this
    ->checkout();
  $this
    ->assertRaw('Your order is complete!');
  $this
    ->drupalLogout();
}