aboutsummaryrefslogtreecommitdiffstats
path: root/tests/user
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-09-10 03:38:01 +0200
committerOleg Pudeyev <oleg@bsdpower.com>2011-11-25 15:04:30 -0500
commit757fcd3e63535f9fda68cf359f849a44059c7b27 (patch)
treeb778effee7c739b5d363516efff67d862e922bb4 /tests/user
parentc4e29bde2331f5ade6883015b8ad90e70bdbd4d3 (diff)
downloadforums-757fcd3e63535f9fda68cf359f849a44059c7b27.tar
forums-757fcd3e63535f9fda68cf359f849a44059c7b27.tar.gz
forums-757fcd3e63535f9fda68cf359f849a44059c7b27.tar.bz2
forums-757fcd3e63535f9fda68cf359f849a44059c7b27.tar.xz
forums-757fcd3e63535f9fda68cf359f849a44059c7b27.zip
[ticket/10345] Add a system to allow multiple plural forms
See http://wiki.phpbb.com/Plural_Rules for explanation and examples. PHPBB3-10345
Diffstat (limited to 'tests/user')
-rw-r--r--tests/user/lang_test.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php
index 6c60583a7b..11e981bb7b 100644
--- a/tests/user/lang_test.php
+++ b/tests/user/lang_test.php
@@ -54,5 +54,23 @@ class phpbb_user_lang_test extends phpbb_test_case
// Bug PHPBB3-9949
$this->assertEquals($user->lang('ARRY', 1, 2), '1 post');
$this->assertEquals($user->lang('ARRY', 1, 's', 2), '1 post');
+
+ // Bug PHPBB3-10345
+ $user = new user;
+ $user->lang = array(
+ 'PLURAL_RULE' => 13,
+ 'ARRY' => array(
+ 0 => '%d is 0', // 0
+ 1 => '%d is 1', // 1
+ 2 => '%d ends with 01-10', // ending with 01-10
+ 3 => '%d ends with 11-19', // ending with 11-19
+ 4 => '%d is part of the last rule', // everything else
+ ),
+ );
+ $this->assertEquals($user->lang('ARRY', 0), '0 is 0');
+ $this->assertEquals($user->lang('ARRY', 1), '1 is 1');
+ $this->assertEquals($user->lang('ARRY', 103), '103 ends with 01-10');
+ $this->assertEquals($user->lang('ARRY', 15), '15 ends with 11-19');
+ $this->assertEquals($user->lang('ARRY', 300), '300 is part of the last rule');
}
}