You are here

public function WebformHtmlHelperTest::testContainsHtml in Webform 8.5

Same name and namespace in other branches
  1. 6.x tests/src/Unit/Utility/WebformHtmlHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformHtmlHelperTest::testContainsHtml()

Tests WebformHtmlHelper::containsHtml().

@dataProvider providerContainsHtml

Parameters

string $text: Text to run through WebformHtmlHelper::containsHtml().

string $expected: The expected result from calling the function.

See also

\Drupal\webform\Utility\WebformHtmlHelper::containsHtml()

File

tests/src/Unit/Utility/WebformHtmlHelperTest.php, line 110

Class

WebformHtmlHelperTest
Tests webform HTML helper.

Namespace

Drupal\Tests\webform\Unit\Utility

Code

public function testContainsHtml($text, $expected) {
  $result = WebformHtmlHelper::containsHtml($text);
  $this
    ->assertEquals($expected, $result, $text);
}