function ModuleDependencyTestCase::testEnableWithoutDependency
7.x system.test | ModuleDependencyTestCase::testEnableWithoutDependency() |
Attempt to enable translation module without locale enabled.
File
- drupal-7.x/
modules/ system/ system.test, line 395 - Tests for system.module.
Class
- ModuleDependencyTestCase
- Test module dependency functionality.
Code
function testEnableWithoutDependency() {
// Attempt to enable content translation without locale enabled.
$edit = array();
$edit['modules[Core][translation][enable]'] = 'translation';
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
$this->assertText(t('Some required modules must be enabled'), 'Dependency required.');
$this->assertModules(array('translation', 'locale'), FALSE);
// Assert that the locale tables weren't enabled.
$this->assertTableCount('languages', FALSE);
$this->assertTableCount('locale', FALSE);
$this->drupalPost(NULL, NULL, t('Continue'));
$this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
$this->assertModules(array('translation', 'locale'), TRUE);
// Assert that the locale tables were enabled.
$this->assertTableCount('languages', TRUE);
$this->assertTableCount('locale', TRUE);
}