diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-12-08 06:39:34 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-12-08 06:39:34 +0000 |
commit | daa59856c3642c192be43104ff945f3182d026d9 (patch) | |
tree | b00197b7ac118255337586f3ca001b44866b1aa6 /modules/system/system.test | |
parent | ddf591963e2f1f3e8d10a230683ee180720469f2 (diff) | |
download | brdo-daa59856c3642c192be43104ff945f3182d026d9.tar.gz brdo-daa59856c3642c192be43104ff945f3182d026d9.tar.bz2 |
#375352 by Damien Tournoud, sun, and chx: Fixed errors caused by adding dependency to non-existing module (with tests).
Diffstat (limited to 'modules/system/system.test')
-rw-r--r-- | modules/system/system.test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/system/system.test b/modules/system/system.test index 522f96b0a..8f94d0c56 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -195,6 +195,32 @@ class ModuleDependencyTestCase extends ModuleTestCase { $this->assertTableCount('languages', TRUE); $this->assertTableCount('locale', TRUE); } + + /** + * Attempt to enable a module with a missing dependency. + */ + function testMissingModules() { + // Test that the system_dependencies_test module is marked + // as missing a dependency. + $this->drupalGet('admin/config/modules'); + $this->assertRaw(t('@module (<span class="admin-missing">missing</span>)', array('@module' => drupal_ucfirst('_missing_dependency'))), t('A module with missing dependencies is marked as such.')); + $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_dependencies_test][enable]"]'); + $this->assert(count($checkbox) == 1, t('Checkbox for the module is disabled.')); + + // Force enable the system_dependencies_test module. + module_enable(array('system_dependencies_test')); + + // Verify that the module is forced to be disabled when submitting + // the module page. + $this->drupalPost('admin/config/modules', array(), t('Save configuration')); + $this->assertText(t('The @module module is missing, so the following module will be disabled: @depends.', array('@module' => '_missing_dependency', '@depends' => 'system_dependencies_test')), t('The module missing dependencies will be disabled.')); + + // Confirm. + $this->drupalPost(NULL, NULL, t('Continue')); + + // Verify that the module has been disabled. + $this->assertModules(array('system_dependencies_test'), FALSE); + } } /** |