public function StringTranslationTraitTest::testFormatPlural in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php \Drupal\Tests\Core\StringTranslation\StringTranslationTraitTest::testFormatPlural()
@covers ::formatPlural
File
- core/
tests/ Drupal/ Tests/ Core/ StringTranslation/ StringTranslationTraitTest.php, line 62
Class
- StringTranslationTraitTest
- @coversDefaultClass \Drupal\Core\StringTranslation\StringTranslationTrait @group StringTranslation
Namespace
Drupal\Tests\Core\StringTranslationCode
public function testFormatPlural() {
$method = $this->reflection
->getMethod('formatPlural');
$method
->setAccessible(TRUE);
$result = $method
->invoke($this->translation, 2, 'apple', 'apples');
$this
->assertInstanceOf(PluralTranslatableMarkup::class, $result);
$this
->assertEquals('apples', $result);
}