public function FormattableMarkupTest::testCount in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php \Drupal\Tests\Component\Render\FormattableMarkupTest::testCount()
- 9 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 49
Class
- FormattableMarkupTest
- Tests the TranslatableMarkup class.
Namespace
Drupal\Tests\Component\RenderCode
public function testCount() {
$string = 'Can I please have a @replacement';
$formattable_string = new FormattableMarkup($string, [
'@replacement' => 'kitten',
]);
$this
->assertEquals(strlen($string), $formattable_string
->count());
}