public function HtmlEscapedTextTest::testToString in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php \Drupal\Tests\Component\Render\HtmlEscapedTextTest::testToString()
@covers ::__toString @covers ::jsonSerialize
@dataProvider providerToString
File
- core/
tests/ Drupal/ Tests/ Component/ Render/ HtmlEscapedTextTest.php, line 23
Class
- HtmlEscapedTextTest
- Tests the HtmlEscapedText class.
Namespace
Drupal\Tests\Component\RenderCode
public function testToString($text, $expected, $message) {
$escapable_string = new HtmlEscapedText($text);
$this
->assertEquals($expected, (string) $escapable_string, $message);
$this
->assertEquals($expected, $escapable_string
->jsonSerialize());
}