Tests 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/dashboard/configure');
foreach ($dashboard_regions as $region => $description) {
$elements = $this
->xpath('//option[@value=:region]', array(
':region' => $region,
));
$this
->assertTrue(!empty($elements), format_string('%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), format_string('%region is not an available choice on the block configuration page.', array(
'%region' => $region,
)));
}
}