Skip to content

Commit

Permalink
Add test for #8250
Browse files Browse the repository at this point in the history
Add tests ensuring {0} works at the end of a message string.
  • Loading branch information
markstory committed Feb 13, 2016
1 parent bec7fea commit 4d8a51f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/TestCase/I18n/I18nTest.php
Expand Up @@ -251,12 +251,18 @@ public function testBasicDomainFunction()
$package = new Package('default');
$package->setMessages([
'Cow' => 'Le moo',
'The {0} is tasty' => 'The {0} is delicious'
'The {0} is tasty' => 'The {0} is delicious',
'Average price {0}' => 'Price Average {0}',
]);
return $package;
});
$this->assertEquals('Le moo', __d('custom', 'Cow'));

$result = __d('custom', 'The {0} is tasty', ['fruit']);
$this->assertEquals('The fruit is delicious', $result);

$result = __d('custom', 'Average price {0}', ['9.99']);
$this->assertEquals('Price Average 9.99', $result);
}

/**
Expand Down

0 comments on commit 4d8a51f

Please sign in to comment.