diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-31 21:36:24 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-31 21:36:24 +0000 |
commit | e17b68cf868f17fd27b64bab5835db832a3c71bd (patch) | |
tree | 1c4ea9f442696937ca0dc0467eea7ab11755df33 | |
parent | 64884285411875bd2e47ee0000c60308dd4b1386 (diff) | |
download | drupal-e17b68cf868f17fd27b64bab5835db832a3c71bd.tar.gz drupal-e17b68cf868f17fd27b64bab5835db832a3c71bd.zip |
#950878 by carlos8f, David_Rothstein: Fixed Disabling the dashboard module permanently removes all blocks from the dashboard.
-rw-r--r-- | modules/dashboard/dashboard.test | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/modules/dashboard/dashboard.test b/modules/dashboard/dashboard.test index 965caa897aa4..420a5a3f7eaa 100644 --- a/modules/dashboard/dashboard.test +++ b/modules/dashboard/dashboard.test @@ -19,7 +19,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { parent::setUp(); // Create and log in an administrative user having access to the dashboard. - $admin_user = $this->drupalCreateUser(array('access dashboard', 'administer blocks')); + $admin_user = $this->drupalCreateUser(array('access dashboard', 'administer blocks', 'access administration pages', 'administer modules')); $this->drupalLogin($admin_user); // Make sure that the dashboard is using the same theme as the rest of the @@ -79,4 +79,37 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { $this->assertTrue(empty($elements), t('%region is not an available choice on the block configuration page.', array('%region' => $region))); } } + + /** + * Test that the dashboard module can be disabled and enabled again, + * retaining its blocks. + */ + function testDisableEnable() { + // Add a new custom block to a dashboard region. + $custom_block = array(); + $custom_block['info'] = $this->randomName(8); + $custom_block['title'] = $this->randomName(8); + $custom_block['body[value]'] = $this->randomName(32); + $custom_block['regions[stark]'] = 'dashboard_main'; + $this->drupalPost('admin/structure/block/add', $custom_block, t('Save block')); + $this->drupalGet('admin/dashboard'); + $this->assertRaw($custom_block['title'], t('Block appears on the dashboard.')); + + $edit = array(); + $edit['modules[Core][dashboard][enable]'] = FALSE; + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + $this->assertNoRaw('assigned to the invalid region', t('Dashboard blocks gracefully disabled.')); + module_list(TRUE); + $this->assertFalse(module_exists('dashboard'), t('Dashboard disabled.')); + + $edit['modules[Core][dashboard][enable]'] = 'dashboard'; + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + module_list(TRUE); + $this->assertTrue(module_exists('dashboard'), t('Dashboard enabled.')); + + $this->drupalGet('admin/dashboard'); + $this->assertRaw($custom_block['title'], t('Block still appears on the dashboard.')); + } } |