From 65d61cc7e63b0172715771f0f72b593070cc809e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 14 Sep 2010 21:51:01 +0000 Subject: #761956 follow-up by bleen18: Fixed missing regions on Dashboard configuration page. --- modules/dashboard/dashboard.test | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'modules/dashboard/dashboard.test') 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))); + } + } } -- cgit v1.2.3