You are here

public function CommerceBaseTesterTestCase::testTestCreateDummyProduct in Commerce Core 7

Make a test product.

File

tests/commerce_base.test, line 832
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 testTestCreateDummyProduct() {

  // Create the product.
  $product = $this
    ->createDummyProduct();

  // Login with the store admin.
  $store_admin = $this
    ->createStoreAdmin();
  $this
    ->drupalLogin($store_admin);

  // Assert that the product is in the product listing.
  $this
    ->drupalGet('admin/commerce/products');
  $this
    ->assertText($product->title, t('Dummy product found on admin page at admin/commerce/products'));
  $this
    ->drupalGet('admin/commerce/products/list');
  $this
    ->assertText($product->title, t('Dummy product found on admin page at admin/commerce/products/list'));
}