You are here

function CommerceCartTestCaseSimpleProduct::setUp in Commerce Core 7

Implementation of setUp().

Overrides DrupalWebTestCase::setUp

File

modules/cart/tests/commerce_cart.test, line 58
Functional tests for the commerce cart module.

Class

CommerceCartTestCaseSimpleProduct
Test cart features for a product display that only has one product attached.

Code

function setUp() {
  parent::setUpHelper('all');

  // Create a dummy product display content type.
  $this
    ->createDummyProductDisplayContentType();

  // Create dummy product display nodes (and their corresponding product
  //  entities).
  $sku = 'PROD-01';
  $product_name = 'Product One';
  $this->product = $this
    ->createDummyProduct($sku, $product_name);
  $this->product_node = $this
    ->createDummyProductNode(array(
    $this->product->product_id,
  ), $product_name);

  // Log as a normal user to test cart process.
  $this
    ->drupalLogin($this->store_customer);

  // Submit the add to cart form.
  $this
    ->drupalPost('node/' . $this->product_node->nid, array(), t('Add to cart'));
}