You are here

function BlockAccessTestCase::assertBlockNotInRegion in Block Access 7

Helper - asserts that a block is not in a given region

File

tests/common.test, line 134
Tests for block_access - common methods

Class

BlockAccessTestCase
Tests for block_access - common methods

Code

function assertBlockNotInRegion($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 not in region %region', array(
    '%block' => $block->bid,
    '%region' => $region,
  ));
  return $this
    ->assertFalse($block_in_region, $msg);
}