public function AuthcacheBlockTest::testFailingMarkupSubstitutionHideFallback in Authenticated User Page Caching (Authcache) 7.2
Ensure that markup is substituted for authcache enabled blocks.
File
- modules/
authcache_block/ authcache_block.test, line 168 - Test cases for the Authcache Block module.
Class
- AuthcacheBlockTest
- Tests for markup substitution.
Code
public function testFailingMarkupSubstitutionHideFallback() {
$region = 'sidebar_first';
$admin = $this
->drupalCreateUser(array(
'administer blocks',
'configure authcache blocks',
));
$this
->drupalLogin($admin);
$block = block_load('block', $this
->createCustomBlock());
$this
->moveBlockToRegion($block, $region);
$edit = array(
'authcache_settings[status]' => TRUE,
'authcache_settings[fallback]' => 'hide',
);
$this
->drupalPost('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure', $edit, t('Save block'));
// Assert that config has no impact when user is not in authcache roles.
$this
->drupalGet('node');
$this
->assertBlockOnPage($block, $region);
$this
->drupalLogout();
// Assert that block is not on the page because authcache prepared the page
// to be saved to the cache.
$this
->drupalGet('node');
$this
->assertNoBlockOnPage($block, $region);
}