ModuleDependencyTestCase::testEnableWithoutDependency

7 system.test ModuleDependencyTestCase::testEnableWithoutDependency()
8 system.test ModuleDependencyTestCase::testEnableWithoutDependency()

Attempt to enable translation module without locale enabled.

File

modules/system/system.test, line 395
Tests for system.module.

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'), t('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.'), t('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);
}
Login or register to post comments