diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-09-14 21:51:01 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-09-14 21:51:01 +0000 |
commit | 65d61cc7e63b0172715771f0f72b593070cc809e (patch) | |
tree | a8e244e1390ea2a14d6786496495514b53c36f0b /modules/dashboard/dashboard.test | |
parent | 679372502bac82b614814312e557979b0151014a (diff) | |
download | brdo-65d61cc7e63b0172715771f0f72b593070cc809e.tar.gz brdo-65d61cc7e63b0172715771f0f72b593070cc809e.tar.bz2 |
#761956 follow-up by bleen18: Fixed missing regions on Dashboard configuration page.
Diffstat (limited to 'modules/dashboard/dashboard.test')
-rw-r--r-- | modules/dashboard/dashboard.test | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/modules/dashboard/dashboard.test b/modules/dashboard/dashboard.test index 8d7f22296..9c03d75c2 100644 --- a/modules/dashboard/dashboard.test +++ b/modules/dashboard/dashboard.test @@ -6,11 +6,11 @@ * Tests for the dashboard module. */ -class DashboardAccessTestCase extends DrupalWebTestCase { +class DashboardBlocksTestCase extends DrupalWebTestCase { public static function getInfo() { return array( - 'name' => 'Dashboard access', - 'description' => 'Test access control for the dashboard.', + 'name' => 'Dashboard blocks', + 'description' => 'Test blocks as used by the dashboard.', 'group' => 'Dashboard', ); } @@ -57,4 +57,26 @@ class DashboardAccessTestCase extends DrupalWebTestCase { $this->assertResponse(403, t('Non-admin has no access to the dashboard.')); $this->assertNoText($custom_block['title'], t('Non-admin has no access to a dashboard block.')); } + + /** + * Test that dashboard regions are displayed or hidden properly. + */ + function testDashboardRegions() { + $dashboard_regions = dashboard_region_descriptions(); + + // Ensure blocks can be placed in dashboard regions. + $this->drupalGet('admin/structure/dashboard'); + foreach ($dashboard_regions as $region => $description) { + $elements = $this->xpath('//option[@value=:region]', array(':region' => $region)); + $this->assertTrue(!empty($elements), t('%region is an available choice on the dashboard block configuration page.', array('%region' => $region))); + } + + // Ensure blocks cannot be placed in dashboard regions on the standard + // blocks configuration page. + $this->drupalGet('admin/structure/block'); + foreach ($dashboard_regions as $region => $description) { + $elements = $this->xpath('//option[@value=:region]', array(':region' => $region)); + $this->assertTrue(empty($elements), t('%region is not an available choice on the block configuration page.', array('%region' => $region))); + } + } } |