You are here

function SimplifiedModulesTestCase::testAutoEnableHiddenDependencies in Simplified Modules 7

Test that hidden dependencies are auto-enabled properly.

File

./simplified_modules.test, line 98

Class

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

Code

function testAutoEnableHiddenDependencies() {

  // Trigger the dependencies we want to be hidden for this test.
  $this
    ->setModuleStatus(array(
    'forum' => FALSE,
    'poll' => FALSE,
  ));
  variable_set('simplified_modules_test_dependencies', TRUE);

  // Enable the module that has the hidden dependencies, and make sure the
  // dependencies were auto-enabled.
  $this
    ->setModuleStatus(array(
    'simplified_modules_test_submodule' => TRUE,
  ));
  $this
    ->assertTrue(module_exists('forum') && module_exists('poll'), t('The hidden dependencies were automatically enabled.'));

  // Disable the module that has the hidden dependencies, and make sure the
  // dependencies were auto-disabled.
  $this
    ->setModuleStatus(array(
    'simplified_modules_test_submodule' => FALSE,
  ));
  $this
    ->assertTrue(!module_exists('forum') && !module_exists('poll'), t('The hidden dependencies were automatically disabled.'));
}