public function AuthcacheBlockTest::testFragemntGet in Authenticated User Page Caching (Authcache) 7.2
Ensure that a block can be retrieved from the front controller.
File
- modules/
authcache_block/ authcache_block.test, line 285 - Test cases for the Authcache Block module.
Class
- AuthcacheBlockTest
- Tests for markup substitution.
Code
public function testFragemntGet() {
$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]' => 'cancel',
);
$this
->drupalPost('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure', $edit, t('Save block'));
$this
->drupalLogout();
$block_id = "{$block->module}-{$block->delta}";
$request_id = 'frag/block/' . $block_id;
$url = authcache_p13n_request_get_callback($request_id, $block_id);
$this
->assertTrue($url);
$this
->drupalGet($GLOBALS['base_root'] . $url['path'], $url['options'], array(
'X-Authcache: 1',
));
$this
->assertText($block->title);
}