You are here

public function IdentityTranslatorTest::getTransChoiceTests in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Tests/IdentityTranslatorTest.php \Symfony\Component\Translation\Tests\IdentityTranslatorTest::getTransChoiceTests()

File

vendor/symfony/translation/Tests/IdentityTranslatorTest.php, line 82

Class

IdentityTranslatorTest

Namespace

Symfony\Component\Translation\Tests

Code

public function getTransChoiceTests() {
  return array(
    array(
      'There are no apples',
      '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples',
      0,
      array(
        '%count%' => 0,
      ),
    ),
    array(
      'There is one apple',
      '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples',
      1,
      array(
        '%count%' => 1,
      ),
    ),
    array(
      'There are 10 apples',
      '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples',
      10,
      array(
        '%count%' => 10,
      ),
    ),
    array(
      'There are 0 apples',
      'There is 1 apple|There are %count% apples',
      0,
      array(
        '%count%' => 0,
      ),
    ),
    array(
      'There is 1 apple',
      'There is 1 apple|There are %count% apples',
      1,
      array(
        '%count%' => 1,
      ),
    ),
    array(
      'There are 10 apples',
      'There is 1 apple|There are %count% apples',
      10,
      array(
        '%count%' => 10,
      ),
    ),
    // custom validation messages may be coded with a fixed value
    array(
      'There are 2 apples',
      'There are 2 apples',
      2,
      array(
        '%count%' => 2,
      ),
    ),
  );
}