You are here

public function AuthcacheBlockTest::testAdminList in Authenticated User Page Caching (Authcache) 7.2

Ensure that a block shows up in the list of personalized elements.

File

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

Class

AuthcacheBlockTest
Tests for markup substitution.

Code

public function testAdminList() {
  $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,
  );
  $this
    ->drupalPost('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure', $edit, t('Save block'));
  $su = $this
    ->drupalCreateUser(array(
    'administer site configuration',
  ));
  $this
    ->drupalLogin($su);
  $this
    ->drupalGet('admin/config/system/authcache/p13n');
  $this
    ->assertText('Blocks', 'A group with the name Blocks should be on the page');
  $this
    ->assertLink('block administration page', 0, 'A link with the label block administration page should be on the page');
  $this
    ->assertLinkByHref('admin/structure/block', 0, 'A link to admin/structure/block should be on the page');
  $this
    ->assertText($block->title, 'The block title should be on the page');
  $this
    ->assertLink('Edit', 0, 'An edit link should be on the page');
  $this
    ->assertLinkByHref('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure', 0, 'The edit link should point to the blocks configuration form');
}