You are here

protected function WebTestBase::assertBlockAppears in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::assertBlockAppears()

Checks to see whether a block appears on the page.

Parameters

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

3 calls to WebTestBase::assertBlockAppears()
DisplayBlockTest::testDeleteBlockDisplay in core/modules/block/src/Tests/Views/DisplayBlockTest.php
Tests removing a block display.
DisplayTest::testInvalidDisplayPlugins in core/modules/views/src/Tests/Plugin/DisplayTest.php
Tests invalid display plugins.
ShortcutLinksTest::testShortcutBlockAccess in core/modules/shortcut/src/Tests/ShortcutLinksTest.php
Tests that the 'access shortcuts' permission is required to access the shortcut block.

File

core/modules/simpletest/src/WebTestBase.php, line 451
Contains \Drupal\simpletest\WebTestBase.

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), format_string('Ensure the block @id appears on the page', array(
    '@id' => $block
      ->id(),
  )));
}