You are here

function BlockAccessTestCase::blockAccessToRegion in Block Access 7

Helper - blocks/unblocks access to a specific region, for a given role ID

1 call to BlockAccessTestCase::blockAccessToRegion()
BlockAccessRegionSpecificTestCase::testCannotAccessRegion in tests/op_region.test
Test we can block $user1 access to a region

File

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

Class

BlockAccessTestCase
Tests for block_access - common methods

Code

function blockAccessToRegion($rid, $region, $blockAccess = TRUE, $module = 'block') {
  $edit = array(
    'dreg_' . $region . '_roles[' . $rid . ']' => $blockAccess,
  );
  $this
    ->drupalPost('admin/structure/block/block-access/edit/' . $module, $edit, t('Save'));
  $this
    ->assertResponse(200);
}