You are here

function UbercartTestHelper::setUp in Ubercart 6.2

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

Configure 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

8 calls to UbercartTestHelper::setUp()
UbercartAttributeTestCase::setUp in uc_attribute/uc_attribute.test
Overrides DrupalWebTestCase::setUp().
UbercartCartCheckoutTestCase::setUp in uc_cart/uc_cart.test
Configure basic Ubercart store components.
UbercartCartLinksTestCase::setUp in uc_cart_links/uc_cart_links.test
Sets up the framework for testing cart links.
UbercartCreditCardTestCase::setUp in payment/uc_credit/uc_credit.test
Implements DrupalWebTestCase::setUp().
UbercartProductKitTestCase::setUp in uc_product_kit/uc_product_kit.test
Overrides DrupalWebTestCase::setUp().

... See full list

8 methods override UbercartTestHelper::setUp()
UbercartAttributeTestCase::setUp in uc_attribute/uc_attribute.test
Overrides DrupalWebTestCase::setUp().
UbercartCartCheckoutTestCase::setUp in uc_cart/uc_cart.test
Configure basic Ubercart store components.
UbercartCartLinksTestCase::setUp in uc_cart_links/uc_cart_links.test
Sets up the framework for testing cart links.
UbercartCreditCardTestCase::setUp in payment/uc_credit/uc_credit.test
Implements DrupalWebTestCase::setUp().
UbercartProductKitTestCase::setUp in uc_product_kit/uc_product_kit.test
Overrides DrupalWebTestCase::setUp().

... See full list

File

uc_store/uc_store.test, line 31
Test functionality provided by uc_store.

Class

UbercartTestHelper
Defines a base helper class for Ubercart tests.

Code

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',
    'ca',
    'token',
    '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 product classes',
    'administer product features',
    'administer products',
    'create products',
    'delete all products',
    'edit all products',
    '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,
  ));
}