function HtmlEscapedTextTest::testCount

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php \Drupal\Tests\Component\Render\HtmlEscapedTextTest::testCount()
  2. 8.9.x core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php \Drupal\Tests\Component\Render\HtmlEscapedTextTest::testCount()
  3. 10 core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php \Drupal\Tests\Component\Render\HtmlEscapedTextTest::testCount()

@covers ::count

File

core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php, line 63

Class

HtmlEscapedTextTest
Tests the HtmlEscapedText class.

Namespace

Drupal\Tests\Component\Render

Code

public function testCount() : void {
    $string = 'Can I have a <em>kitten</em>';
    $escapable_string = new HtmlEscapedText($string);
    $this->assertEquals(strlen($string), $escapable_string->count());
}

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