function TranslationManagerTest::providerTestFormatPlural
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TranslationManagerTest::providerTestFormatPlural()
- 10 core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TranslationManagerTest::providerTestFormatPlural()
- 11.x core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TranslationManagerTest::providerTestFormatPlural()
Provides some test data for formatPlural()
Return value
array
File
-
core/
tests/ Drupal/ Tests/ Core/ StringTranslation/ TranslationManagerTest.php, line 38
Class
- TranslationManagerTest
- @coversDefaultClass \Drupal\Core\StringTranslation\TranslationManager @group StringTranslation
Namespace
Drupal\Tests\Core\StringTranslationCode
public function providerTestFormatPlural() {
return [
[
1,
'Singular',
'@count plural',
[],
[],
'Singular',
],
[
2,
'Singular',
'@count plural',
[],
[],
'2 plural',
],
// @todo support locale_get_plural
[
2,
'Singular',
'@count @arg',
[
'@arg' => '<script>',
],
[],
'2 <script>',
],
[
2,
'Singular',
'@count %arg',
[
'%arg' => '<script>',
],
[],
'2 <em class="placeholder"><script></em>',
],
[
1,
'Singular',
'@count plural',
[],
[
'langcode' => NULL,
],
'Singular',
],
[
1,
'Singular',
'@count plural',
[],
[
'langcode' => 'es',
],
'Singular',
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.