public function SafeMarkupTest::testHtmlEscapedText in Drupal 8
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 - Contains \Drupal\Tests\Component\Utility\SafeMarkupTest.
Class
- SafeMarkupTest
- Tests marking strings as safe.
Namespace
Drupal\Tests\Component\UtilityCode
public function testHtmlEscapedText($text, $expected, $message) {
$result = new HtmlEscapedText($text);
$this
->assertEquals($expected, $result, $message);
}