You are here

function CommerceProductUIAdminTest::setUp in Commerce Core 7

Implementation of setUp().

Overrides DrupalWebTestCase::setUp

File

modules/product/tests/commerce_product_ui.test, line 29
Functional tests for the commerce product ui module.

Class

CommerceProductUIAdminTest
Test the product and product type CRUD.

Code

function setUp() {
  $modules = parent::setUpHelper('all');
  parent::setUp($modules);

  // Set a clean starting point. $_GET can be different between the UI test
  // runner and the command line one. As a consequence, the 'active' classes
  // on the links can end up being different.
  $_GET['q'] = '';

  // User creation for different operations.
  $this->store_admin = $this
    ->createStoreAdmin();
  $this->store_customer = $this
    ->createStoreCustomer();

  // Get the product types, and if the default product type is not present,
  // create it.
  $product_types = commerce_product_types();
  if (empty($product_types['product'])) {
    $this
      ->createDummyProductType('product');
    commerce_product_types_reset();
  }
}