You are here

public function TranslationManagerTest::providerTestFormatPlural in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 39
Contains \Drupal\Tests\Core\StringTranslation\TranslationManagerTest.

Class

TranslationManagerTest
@coversDefaultClass \Drupal\Core\StringTranslation\TranslationManager @group StringTranslation

Namespace

Drupal\Tests\Core\StringTranslation

Code

public function providerTestFormatPlural() {
  return array(
    [
      1,
      'Singular',
      '@count plural',
      array(),
      array(),
      'Singular',
    ],
    [
      2,
      'Singular',
      '@count plural',
      array(),
      array(),
      '2 plural',
    ],
    // @todo support locale_get_plural
    [
      2,
      'Singular',
      '@count @arg',
      array(
        '@arg' => '<script>',
      ),
      array(),
      '2 &lt;script&gt;',
    ],
    [
      2,
      'Singular',
      '@count %arg',
      array(
        '%arg' => '<script>',
      ),
      array(),
      '2 <em class="placeholder">&lt;script&gt;</em>',
    ],
    [
      1,
      'Singular',
      '@count plural',
      array(),
      array(
        'langcode' => NULL,
      ),
      'Singular',
    ],
    [
      1,
      'Singular',
      '@count plural',
      array(),
      array(
        'langcode' => 'es',
      ),
      'Singular',
    ],
  );
}