function BlockAccessTestCase::assertBlockInRegion in Block Access 7
Helper - asserts that a block is in a given region
3 calls to BlockAccessTestCase::assertBlockInRegion()
- BlockAccessDisableTestCase::testOperationGranted in tests/
op_basic_disable.test - Test $user1 can do operation
- BlockAccessEnableTestCase::testOperationGranted in tests/
op_basic_enable.test - Test $user1 can do operation
- BlockAccessMoveTestCase::testOperationGranted in tests/
op_basic_move.test - Test $user1 can do operation
File
- tests/
common.test, line 118 - Tests for block_access - common methods
Class
- BlockAccessTestCase
- Tests for block_access - common methods
Code
function assertBlockInRegion($block, $region, $msg = '') {
$theme = variable_get('theme_custom', 'bartik');
$block_in_region = db_select('block', 'b')
->fields('b')
->condition('bid', $block->bid, '=')
->condition('theme', $theme, '=')
->condition('region', $region, '=')
->execute()
->rowCount();
$msg = $msg ? $msg : t('Block %block is in region %region', array(
'%block' => $block->bid,
'%region' => $region,
));
return $this
->assertTrue($block_in_region, $msg);
}