1 system.test ModuleDependencyTestCase::testEnableWithoutDependency()

Attempt to enable translation module without locale enabled.

File

core/modules/system/tests/system.test, line 350
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[Translation][translation][enable]'] = 'translation';
  $this->backdropPost('admin/modules', $edit, t('Save configuration'));
  $this->assertText(t('Some required modules must be enabled'), 'Dependency required.');

  $this->assertModules(array('translation', 'locale', 'language'), FALSE);

  // Assert that the locale tables weren't enabled.
  $this->assertTableCount('language', FALSE);
  $this->assertTableCount('locale', FALSE);

  $this->backdropPost(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('language', TRUE);
  $this->assertTableCount('locale', TRUE);
}