You are here

protected function PreviewTest::assertClass in Zircon Profile 8

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

Asserts that an element has a given class.

Parameters

\SimpleXMLElement $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/src/Tests/PreviewTest.php
Tests pagers in the preview form.

File

core/modules/views_ui/src/Tests/PreviewTest.php, line 305
Contains \Drupal\views_ui\Tests\PreviewTest.

Class

PreviewTest
Tests the UI preview functionality.

Namespace

Drupal\views_ui\Tests

Code

protected function assertClass(\SimpleXMLElement $element, $class, $message = NULL) {
  if (!isset($message)) {
    $message = "Class .{$class} found.";
  }
  $this
    ->assertTrue(strpos($element['class'], $class) !== FALSE, $message);
}