You are here

function SimplifiedModulesTestCase::testDisableSimplifiedModules in Simplified Modules 7

Test disabling Simplified Modules at the same time as the submodule.

File

./simplified_modules.test, line 72

Class

SimplifiedModulesTestCase
Tests for auto-enabling and disabling hidden submodules and dependencies.

Code

function testDisableSimplifiedModules() {

  // Trigger the submodules we want to be hidden for this test.
  variable_set('simplified_modules_test_submodules', TRUE);

  // First enable both modules and make sure the submodule is automatically
  // enabled.
  $this
    ->setModuleStatus(array(
    'forum' => TRUE,
    'poll' => TRUE,
  ));
  $this
    ->assertTrue(module_exists('simplified_modules_test_submodule'), t('The submodule was automatically enabled.'));

  // Disable Simplified Modules and one of the submodule's dependencies, and
  // make sure that the submodule is correctly disabled (even though the
  // Simplified Modules module which controls this is itself in the process
  // of being disabled).
  $this
    ->setModuleStatus(array(
    'forum' => FALSE,
    'simplified_modules' => FALSE,
  ));
  $this
    ->assertFalse(module_exists('simplified_modules_test_submodule'), t('The submodule was automatically disabled even while the Simplified Modules module was also being disabled.'));
}