public function BlockTest::testBlockAccess in Drupal 9
Same name and namespace in other branches
- 8 core/modules/block/tests/src/Functional/BlockTest.php \Drupal\Tests\block\Functional\BlockTest::testBlockAccess()
Tests the block access.
File
- core/
modules/ block/ tests/ src/ Functional/ BlockTest.php, line 534
Class
- BlockTest
- Tests basic block functionality.
Namespace
Drupal\Tests\block\FunctionalCode
public function testBlockAccess() {
$this
->drupalPlaceBlock('test_access', [
'region' => 'help',
]);
$this
->drupalGet('<front>');
$this
->assertSession()
->pageTextNotContains('Hello test world');
\Drupal::state()
->set('test_block_access', TRUE);
$this
->drupalGet('<front>');
$this
->assertSession()
->pageTextContains('Hello test world');
}