You are here

protected function WebTestBase::assertBlockAppears in Drupal 8

Checks to see whether a block appears on the page.

Parameters

\Drupal\block\Entity\Block $block: The block entity to find on the page.

File

core/modules/simpletest/src/WebTestBase.php, line 233

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertBlockAppears(Block $block) {
  $result = $this
    ->findBlockInstance($block);
  $this
    ->assertTrue(!empty($result), new FormattableMarkup('Ensure the block @id appears on the page', [
    '@id' => $block
      ->id(),
  ]));
}