You are here

protected function PreviewTest::assertClass in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php \Drupal\Tests\views_ui\FunctionalJavascript\PreviewTest::assertClass()

Asserts that an element has a given class.

Parameters

\Behat\Mink\Element\NodeElement $element: The element to test.

string $class: The class to assert.

string $message: (optional) A verbose message to output.

1 call to PreviewTest::assertClass()
PreviewTest::testPreviewWithPagersUI in core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
Tests pagers in the preview form.

File

core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php, line 301

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

protected function assertClass(NodeElement $element, $class, $message = NULL) {
  if (!isset($message)) {
    $message = "Class .{$class} found.";
  }
  $this
    ->assertStringContainsString($class, $element
    ->getAttribute('class'), $message);
}