function EnableModuleWithoutDependencyTest::testEnableWithoutDependency in SimpleTest 6
File
- tests/modules_system.test, line 103
Class
- EnableModuleWithoutDependencyTest
Code
function testEnableWithoutDependency() {
$current_modules = module_list(true, false);
foreach ($current_modules as $module) {
if (!in_array($module, drupal_required_modules())) {
$this
->drupalModuleDisable($module);
}
}
$web_user = $this
->drupalCreateUserRolePerm(array(
'access administration pages',
'administer site configuration',
));
$this
->drupalLoginUser($web_user);
$edit = array(
'status[forum]' => 'forum',
);
$this
->drupalPost('admin/build/modules/list/confirm', $edit, 'Save configuration');
$this
->assertWantedRaw(t('Some required modules must be enabled'), t('Make sure the dependency error is shown'));
$this
->assertFalse(module_exists('forum'), t('Check to make sure that the module has not somehow become enabled'));
}