You are here

public function CommerceInvoiceTestCase::setUp in Commerce Invoice 7.2

Implementation of setUp().

Overrides DrupalWebTestCase::setUp

File

tests/commerce_invoice.test, line 37
Functional tests for the commerce invoice module.

Class

CommerceInvoiceTestCase
Test commerce invoices.

Code

public function setUp() {

  // Enable all Commerce modules and Commerce Invoice.
  $modules = parent::setUpHelper('all');
  $modules[] = 'commerce_invoice';
  parent::setUp($modules);
  $this->product100 = $this
    ->createDummyProduct('', '', 100, 'USD');
  $this->product50 = $this
    ->createDummyProduct('', '', 50, 'USD');

  // Make sure all needed rules are available and enabled.
  foreach ($this->rules as $ruleName) {
    $rule = rules_config_load($ruleName);
    $this
      ->assertTrue($rule->status & ENTITY_IN_CODE && !($rule->status & ENTITY_IN_DB), $ruleName . ' can be loaded and has the right status.');
    $rule->active = TRUE;
    $rule
      ->save();
  }
}