You are here

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

Ensure that access to authcache configuration on blocks is checked.

File

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

Class

AuthcacheBlockTest
Tests for markup substitution.

Code

public function testAdminAccess() {
  $admin = $this
    ->drupalCreateUser(array(
    'administer blocks',
  ));
  $this
    ->drupalLogin($admin);
  $block = block_load('block', $this
    ->createCustomBlock());
  $this
    ->drupalGet('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure');
  $this
    ->assertNoField('authcache_settings[status]');
  $admin = $this
    ->drupalCreateUser(array(
    'administer blocks',
    'configure authcache blocks',
  ));
  $this
    ->drupalLogin($admin);
  $this
    ->drupalGet('admin/structure/block/manage/' . $block->module . '/' . $block->delta . '/configure');
  $this
    ->assertField('authcache_settings[status]');
}