You are here

public function FormattableMarkupTest::testCount in Zircon Profile 8

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

Class

FormattableMarkupTest
Tests the TranslatableMarkup class.

Namespace

Drupal\Tests\Component\Render

Code

public function testCount() {
  $string = 'Can I please have a @replacement';
  $formattable_string = new FormattableMarkup($string, [
    '@replacement' => 'kitten',
  ]);
  $this
    ->assertEquals(strlen($string), $formattable_string
    ->count());
}