You are here

public function BlockTest::testBlockAccess in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block/src/Tests/BlockTest.php \Drupal\block\Tests\BlockTest::testBlockAccess()

Tests the block access.

File

core/modules/block/src/Tests/BlockTest.php, line 455
Contains \Drupal\block\Tests\BlockTest.

Class

BlockTest
Tests basic block functionality.

Namespace

Drupal\block\Tests

Code

public function testBlockAccess() {
  $this
    ->drupalPlaceBlock('test_access', [
    'region' => 'help',
  ]);
  $this
    ->drupalGet('<front>');
  $this
    ->assertNoText('Hello test world');
  \Drupal::state()
    ->set('test_block_access', TRUE);
  $this
    ->drupalGet('<front>');
  $this
    ->assertText('Hello test world');
}