function 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 83

Class

SafeMarkupTest
Tests marking strings as safe.

Namespace

Drupal\Tests\Component\Utility

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.