You are here

protected function PanelsIPETestTrait::assertBlockContains in Panels 8.4

Same name and namespace in other branches
  1. 8.3 panels_ipe/tests/src/FunctionalJavascript/PanelsIPETestTrait.php \Drupal\Tests\panels_ipe\FunctionalJavascript\PanelsIPETestTrait::assertBlockContains()

Asserts that an on-screen Block contains the given content.

Parameters

string $block_id: The unique ID of the Block.

string $content: The content to check.

string $message: (Optional) message to pass to the assertContains() call.

File

panels_ipe/tests/src/FunctionalJavascript/PanelsIPETestTrait.php, line 30

Class

PanelsIPETestTrait
Trait which can be used to test Panels IPE components.

Namespace

Drupal\Tests\panels_ipe\FunctionalJavascript

Code

protected function assertBlockContains($block_id, $content, $message = '') {
  $selector = '[data-block-id="' . $block_id . '"]';
  $block_element = $this
    ->getSession()
    ->getPage()
    ->find('css', $selector);
  $this
    ->assertContains($content, $block_element
    ->getHtml(), $message);
}