You are here

public function CommerceRecurringEnableDisableTestCase::testCommerceRecurringDisableUninstall in Commerce Recurring Framework 7.2

Test if the module can be correctly uninstalled.

File

tests/commerce_recurring.test, line 937
Unit tests for the commerce recurring module.

Class

CommerceRecurringEnableDisableTestCase
Test module enabling/disabling functionality.

Code

public function testCommerceRecurringDisableUninstall() {
  $this
    ->disableCommerceRecurring();

  // Uninstall the module.
  $edit = array();
  $edit['uninstall[' . $this->module . ']'] = $this->module;
  $this
    ->drupalPost('admin/modules/uninstall', $edit, t('Uninstall'));
  $this
    ->drupalPost(NULL, NULL, t('Uninstall'));
  $this
    ->assertText(t('The selected modules have been uninstalled.'), t('Modules status has been updated.'));
  $this
    ->assertModules(array(
    $this->module,
  ), FALSE);
  $this
    ->assertModuleTablesDoNotExist($this->module);
  $this
    ->assertCommerRecurringProductType(FALSE);
  $fields = array(
    'commerce_recurring_ini_price',
    'commerce_recurring_rec_price',
    'commerce_recurring_ini_period',
    'commerce_recurring_rec_period',
    'commerce_recurring_end_period',
  );
  $this
    ->assertCommerceRecurringFields($fields, 'commerce_product', 'recurring', FALSE);
  $fields = array(
    'commerce_recurring_ref_product',
    'commerce_recurring_order',
    'commerce_recurring_fixed_price',
  );
  $this
    ->assertCommerceRecurringFields($fields, 'commerce_recurring', 'product', FALSE);
}