You are here

public function HtmlEscapedTextTest::testToString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 28
Contains \Drupal\Tests\Component\Render\HtmlEscapedTextTest.

Class

HtmlEscapedTextTest
Tests the HtmlEscapedText class.

Namespace

Drupal\Tests\Component\Render

Code

public function testToString($text, $expected, $message) {
  $escapeable_string = new HtmlEscapedText($text);
  $this
    ->assertEquals($expected, (string) $escapeable_string, $message);
  $this
    ->assertEquals($expected, $escapeable_string
    ->jsonSerialize());
}