You are here

protected function UbercartTestHelper::setUp in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_store/uc_store.test \UbercartTestHelper::setUp()

Overrides DrupalWebTestCase::setUp().

Configures basic Ubercart store components.

Parameters

$modules: Optional list of extra modules to install.

$permissions: Optional list of extra permissions for $this->adminUser.

Overrides DrupalWebTestCase::setUp

16 calls to UbercartTestHelper::setUp()
UbercartAddressTestCase::setUp in uc_store/tests/uc_address.test
Overrides DrupalWebTestCase::setUp().
UbercartAjaxTestCase::setUp in uc_store/tests/uc_ajax.test
Overrides DrupalWebTestCase::setUp().
UbercartAttributeCheckoutTestCase::setUp in uc_attribute/tests/uc_attribute_checkout.test
Overrides DrupalWebTestCase::setUp().
UbercartAttributeTestCase::setUp in uc_attribute/tests/uc_attribute.test
Overrides DrupalWebTestCase::setUp().
UbercartCartCheckoutTestCase::setUp in uc_cart/tests/uc_cart.test
Overrides DrupalWebTestCase::setUp().

... See full list

16 methods override UbercartTestHelper::setUp()
UbercartAddressTestCase::setUp in uc_store/tests/uc_address.test
Overrides DrupalWebTestCase::setUp().
UbercartAjaxTestCase::setUp in uc_store/tests/uc_ajax.test
Overrides DrupalWebTestCase::setUp().
UbercartAttributeCheckoutTestCase::setUp in uc_attribute/tests/uc_attribute_checkout.test
Overrides DrupalWebTestCase::setUp().
UbercartAttributeTestCase::setUp in uc_attribute/tests/uc_attribute.test
Overrides DrupalWebTestCase::setUp().
UbercartCartCheckoutTestCase::setUp in uc_cart/tests/uc_cart.test
Overrides DrupalWebTestCase::setUp().

... See full list

File

uc_store/tests/uc_store.test, line 32
Test functionality provided by uc_store.

Class

UbercartTestHelper
Defines a base helper class for Ubercart tests.

Code

protected function setUp($modules = array(), $permissions = array()) {

  // Enable the core Ubercart modules and dependencies, along with any other modules passed as arguments.
  $modules = array_merge(array(
    'uc_store',
    'rules',
    'uc_order',
    'uc_product',
    'uc_cart',
  ), $modules);
  call_user_func_array(array(
    'parent',
    'setUp',
  ), $modules);

  // Create a store administrator user account.
  $this->adminUser = $this
    ->drupalCreateUser(array_merge($permissions, array(
    'administer store',
    'administer order workflow',
    'administer product classes',
    'administer product features',
    'administer products',
    'create product content',
    'delete any product content',
    'edit any product content',
    'create orders',
    'view all orders',
    'edit orders',
    'delete orders',
    'unconditionally delete orders',
  )));

  // Create a simple customer user account.
  $this->customer = $this
    ->drupalCreateUser(array(
    'view own orders',
  ));

  // Create a test product.
  $this->product = $this
    ->createProduct(array(
    'uid' => $this->adminUser->uid,
  ));
}