You are here

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

Test whether the given block is found on the page.

4 calls to AuthcacheBlockTest::assertBlockOnPage()
AuthcacheBlockTest::moveBlockToRegion in modules/authcache_block/authcache_block.test
Utility function: Set region of a block.
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::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 99
Test cases for the Authcache Block module.

Class

AuthcacheBlockTest
Tests for markup substitution.

Code

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

  // Confirm that the custom block was found at the proper region.
  $xpath = $this
    ->buildXPathQuery('//div[@class=:region-class]//div[@id=:block-id]/*', array(
    ':region-class' => 'region region-' . str_replace('_', '-', $region),
    ':block-id' => 'block-' . $block->module . '-' . $block->delta,
  ));
  $this
    ->assertFieldByXPath($xpath, NULL, format_string('Custom block found in %region_name region.', array(
    '%region_name' => $region,
  )));
}