You are here

public function CommerceBaseTesterTestCase::testTestCreateDummyProductNode in Commerce Core 7

Test the createDummyProductNode function.

File

tests/commerce_base.test, line 869
Defines abstract base test class for the Commerce module tests.

Class

CommerceBaseTesterTestCase
Test class to test the CommerceBaseTestCase functions. All testTestFoo functions have "testTest" in the name to indicate that they are verifying that a test is working. Somewhat "meta" to do this, but it eases test development.

Code

public function testTestCreateDummyProductNode() {

  // 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';
  $product = $this
    ->createDummyProduct($sku, $product_name);
  $product_node = $this
    ->createDummyProductNode(array(
    $product->product_id,
  ), $product_name);
  $this
    ->drupalLogin($this->site_admin);
  $this
    ->drupalGet("node/{$product_node->nid}");
  $this
    ->assertText($product_name, t('Product !product_name created successfully', array(
    '!product_name' => $product_name,
  )));
}