mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding tests for i18n plurals, closes #3399
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5779 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1545b730ae
commit
a1958bf820
1 changed files with 22 additions and 2 deletions
|
@ -34,9 +34,29 @@ uses('i18n');
|
|||
* @subpackage cake.tests.cases.libs
|
||||
*/
|
||||
class I18nTest extends UnitTestCase {
|
||||
function setUp() {
|
||||
$calledFrom = debug_backtrace();
|
||||
$this->dir = dirname($calledFrom[0]['file']);
|
||||
}
|
||||
|
||||
function skip() {
|
||||
$this->skipif (true, 'I18nTest not implemented');
|
||||
function tearDown() {
|
||||
unset($this->dir);
|
||||
}
|
||||
|
||||
function testPlural() {
|
||||
$result = I18n::translate('chair', 'chairs', null, 5, 1, $this->dir);
|
||||
$this->assertEqual($result, 'chair');
|
||||
|
||||
$result = I18n::translate('chair', 'chairs', null, 5, 2, $this->dir);
|
||||
$this->assertEqual($result, 'chairs');
|
||||
|
||||
$data['count'] = 1;
|
||||
$result = I18n::translate('chair', 'chairs', null, 5, $data['count'], $this->dir);
|
||||
$this->assertEqual($result, 'chair');
|
||||
|
||||
$data['count'] = 8;
|
||||
$result = I18n::translate('chair', 'chairs', null, 5, $data['count'], $this->dir);
|
||||
$this->assertEqual($result, 'chairs');
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue