You are here

public function CommerceBaseTesterTestCase::testTestCreateDummyTaxRate in Commerce Core 7

Test creating a new tax rate.

File

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

  // Create a dummy tax type.
  $tax_type = $this
    ->createDummyTaxType();

  // Create a dummy tax rate.
  $tax_rate = $this
    ->createDummyTaxRate();

  // Create and login with a store admin user.
  $store_admin = $this
    ->createStoreAdmin();
  $this
    ->drupalLogin($store_admin);

  // Access to the tax type listing page and assert that the dummy tax type
  // is present.
  $this
    ->drupalGet('admin/commerce/config/taxes/rates');
  $this
    ->assertText($tax_rate['display_title'], t('Dummy tax rate found on admin page at admin/commerce/config/taxes/rates'));
}