function FormattableMarkupTest::testCount
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php \Drupal\Tests\Component\Render\FormattableMarkupTest::testCount()
- 8.9.x core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php \Drupal\Tests\Component\Render\FormattableMarkupTest::testCount()
- 10 core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php \Drupal\Tests\Component\Render\FormattableMarkupTest::testCount()
@covers ::count
File
-
core/
tests/ Drupal/ Tests/ Component/ Render/ FormattableMarkupTest.php, line 51
Class
- FormattableMarkupTest
- Tests the TranslatableMarkup class.
Namespace
Drupal\Tests\Component\RenderCode
public function testCount() : void {
$string = 'Can I have a @replacement';
$formattable_string = new FormattableMarkup($string, [
'@replacement' => 'kitten',
]);
$this->assertEquals(strlen($string), $formattable_string->count());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.