public function CommerceTaxUIAdminTest::testCommerceTaxUIDeleteTaxTypeWithRates in Commerce Core 7
Text the deletion of a tax type that already has rates.
File
- modules/
tax/ tests/ commerce_tax_ui.test, line 547 - Functional tests for the commerce tax UI module.
Class
- CommerceTaxUIAdminTest
- Functional tests for the commerce tax UI module.
Code
public function testCommerceTaxUIDeleteTaxTypeWithRates() {
// Create a tax rate associated with the type.
$tax_rate = $this
->createDummyTaxRate();
// Login with store admin user.
$this
->drupalLogin($this->store_admin);
// Access the tax rate type delete page.
$this
->drupalGet('admin/commerce/config/taxes/types/' . strtr($this->tax_type['name'], '_', '-') . '/delete');
// Check that the tax can't be deleted as it has a rate associated to it.
$this
->assertTitle(t('Cannot delete the !title tax type', array(
'!title' => $this->tax_type['title'],
)) . ' | Drupal', t('Page title for tax type deletion with rates associated to it is correct'));
$this
->assertText(t('There is a tax rate of this type. It cannot be deleted.'), t('A message that prevents user from deleting a tax type with rates associated to it is displayed'));
}