You are here

protected function AuthcacheBlockTest::moveBlockToRegion in Authenticated User Page Caching (Authcache) 7.2

Utility function: Set region of a block.

See also

BlockTestCase::moveBlockToRegion()

5 calls to AuthcacheBlockTest::moveBlockToRegion()
AuthcacheBlockTest::testAdminList in modules/authcache_block/authcache_block.test
Ensure that a block shows up in the list of personalized elements.
AuthcacheBlockTest::testFailingMarkupSubstitutionCancelFallback in modules/authcache_block/authcache_block.test
Ensure that markup is substituted for authcache enabled blocks.
AuthcacheBlockTest::testFailingMarkupSubstitutionHideFallback in modules/authcache_block/authcache_block.test
Ensure that markup is substituted for authcache enabled blocks.
AuthcacheBlockTest::testFragemntGet in modules/authcache_block/authcache_block.test
Ensure that a block can be retrieved from the front controller.
AuthcacheBlockTest::testMarkupSubstitution in modules/authcache_block/authcache_block.test
Ensure that markup is substituted for authcache enabled blocks.

File

modules/authcache_block/authcache_block.test, line 64
Test cases for the Authcache Block module.

Class

AuthcacheBlockTest
Tests for markup substitution.

Code

protected function moveBlockToRegion(stdClass $block, $region) {

  // Set the created block to a specific region.
  $edit = array();
  $edit['blocks[' . $block->module . '_' . $block->delta . '][region]'] = $region;
  $this
    ->drupalPost('admin/structure/block', $edit, t('Save blocks'));

  // Confirm that the block was moved to the proper region.
  $this
    ->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', array(
    '%region_name' => $region,
  )));

  // Confirm that the block is being displayed.
  $this
    ->drupalGet('node');
  $this
    ->assertText($block->title, 'Block successfully being displayed on the page.');
  $this
    ->assertBlockOnPage($block, $region);
}