You are here

public function IdentityTranslatorTest::getTransChoiceTests in Plug 7

File

lib/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,
      ),
    ),
  );
}