public function TranslationManagerTest::providerTestTranslatePlaceholder in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TranslationManagerTest::providerTestTranslatePlaceholder()
- 10 core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php \Drupal\Tests\Core\StringTranslation\TranslationManagerTest::providerTestTranslatePlaceholder()
Provides test data for translate().
Return value
array
File
- core/
tests/ Drupal/ Tests/ Core/ StringTranslation/ TranslationManagerTest.php, line 92 - Contains \Drupal\Tests\Core\StringTranslation\TranslationManagerTest.
Class
- TranslationManagerTest
- @coversDefaultClass \Drupal\Core\StringTranslation\TranslationManager @group StringTranslation
Namespace
Drupal\Tests\Core\StringTranslationCode
public function providerTestTranslatePlaceholder() {
return [
[
'foo @bar',
[
'@bar' => 'bar',
],
'foo bar',
],
[
'bar %baz',
[
'%baz' => 'baz',
],
'bar <em class="placeholder">baz</em>',
],
[
'bar @bar %baz',
[
'@bar' => 'bar',
'%baz' => 'baz',
],
'bar bar <em class="placeholder">baz</em>',
],
[
'bar %baz @bar',
[
'%baz' => 'baz',
'@bar' => 'bar',
],
'bar <em class="placeholder">baz</em> bar',
],
];
}