You are here

function BlockAccessTestCase::setBlockAccessPerm in Block Access 7

Helper - allows/disallows operation on a given block, for a given role ID

7 calls to BlockAccessTestCase::setBlockAccessPerm()
BlockAccessConfigSpecificTestCase::testConfigOperations in tests/op_config.test
Test all config-specific operations
BlockAccessConfigTestCase::setUp in tests/op_basic_config.test
Sets up a Drupal site for running functional and integration tests.
BlockAccessDeleteTestCase::setUp in tests/op_basic_delete.test
Sets up a Drupal site for running functional and integration tests.
BlockAccessDisableTestCase::setUp in tests/op_basic_disable.test
Sets up a Drupal site for running functional and integration tests.
BlockAccessEnableTestCase::setUp in tests/op_basic_enable.test
Sets up a Drupal site for running functional and integration tests.

... See full list

File

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

Class

BlockAccessTestCase
Tests for block_access - common methods

Code

function setBlockAccessPerm($block, $rid, $operation, $allow = TRUE) {
  $edit = array(
    $operation . '_roles[' . $rid . ']' => $allow,
  );
  $this
    ->drupalPost('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure', $edit, t('Save block'));
  $this
    ->assertResponse(200);
}