function BlockTestCase::moveBlockToRegion
10 calls to BlockTestCase::moveBlockToRegion()
- BlockTestCase::testBlock in drupal-7.x/modules/block/block.test
- Test configuring and moving a module-define block to specific regions.
- BlockTestCase::testBlock in drupal-7.x/modules/block/block.test
- Test configuring and moving a module-define block to specific regions.
- BlockTestCase::testBlockVisibility in drupal-7.x/modules/block/block.test
- Test block visibility.
- BlockTestCase::testBlockVisibility in drupal-7.x/modules/block/block.test
- Test block visibility.
- BlockTestCase::testBlockVisibilityListedEmpty in drupal-7.x/modules/block/block.test
- Test block visibility when using "pages" restriction but leaving
"pages" textarea empty
... See full list
Archivo
- drupal-7.x/modules/block/block.test, line 338
- Tests for block.module.
Class
- BlockTestCase
Código
function moveBlockToRegion($block, $region) {
$edit = array();
$edit['blocks[' . $block['module'] . '_' . $block['delta'] . '][region]'] = $region;
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', array('%region_name' => $region)));
$this->drupalGet('node');
$this->assertText(t($block['title']), 'Block successfully being displayed on the page.');
$xpath = $this->buildXPathQuery('//div[@class=:region-class]//div[@id=:block-id]/*', array(
':region-class' => 'region region-' . str_replace('_', '-', $region),
':block-id' => 'block-' . $block['module'] . '-' . $block['delta'],
));
$this->assertFieldByXPath($xpath, NULL, format_string('Custom block found in %region_name region.', array('%region_name' => $region)));
}