You are here

function SafeMarkupTest::testHtmlEscapedText in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php \Drupal\Tests\Component\Utility\SafeMarkupTest::testHtmlEscapedText()

Tests Drupal\Component\Render\HtmlEscapedText.

Verifies that the result of SafeMarkup::checkPlain() is the same as using HtmlEscapedText directly.

@dataProvider providerCheckPlain

Parameters

string $text: The text to provide to the HtmlEscapedText constructor.

string $expected: The expected output from the function.

string $message: The message to provide as output for the test.

File

core/tests/Drupal/Tests/Component/Utility/SafeMarkupTest.php, line 94
Contains \Drupal\Tests\Component\Utility\SafeMarkupTest.

Class

SafeMarkupTest
Tests marking strings as safe.

Namespace

Drupal\Tests\Component\Utility

Code

function testHtmlEscapedText($text, $expected, $message) {
  $result = new HtmlEscapedText($text);
  $this
    ->assertEquals($expected, $result, $message);
}