diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2011-09-20 23:06:43 +0200 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-11-25 15:10:50 -0500 |
commit | 814220f1c13ecac42f9d9aceb4489d5db282b2ac (patch) | |
tree | 9210cea5c2c570e2cf40555d4bba740aabf3ba5e /tests/user | |
parent | 4c2c842a7dc2a4ce01eae23790af305c73de79fa (diff) | |
download | forums-814220f1c13ecac42f9d9aceb4489d5db282b2ac.tar forums-814220f1c13ecac42f9d9aceb4489d5db282b2ac.tar.gz forums-814220f1c13ecac42f9d9aceb4489d5db282b2ac.tar.bz2 forums-814220f1c13ecac42f9d9aceb4489d5db282b2ac.tar.xz forums-814220f1c13ecac42f9d9aceb4489d5db282b2ac.zip |
[ticket/10345] Add tests for array() as first parameter on call to $user->lang()
PHPBB3-10345
Diffstat (limited to 'tests/user')
-rw-r--r-- | tests/user/lang_test.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php index 971a9475f0..ffc3ea1302 100644 --- a/tests/user/lang_test.php +++ b/tests/user/lang_test.php @@ -34,6 +34,12 @@ class phpbb_user_lang_test extends phpbb_test_case 1 => '1 post', // 1.x 2 => '%1$.1f posts', // 0.x, 2+.x ), + 'dateformat' => array( + 'AGO' => array( + 1 => '%d second', + 2 => '%d seconds', + ), + ), ); // No param @@ -69,11 +75,14 @@ class phpbb_user_lang_test extends phpbb_test_case $this->assertEquals($user->lang('ARRY_FLOAT', 2.0), '2.0 posts'); $this->assertEquals($user->lang('ARRY_FLOAT', 2.51), '2.5 posts'); - // ticket PHPBB3-9949 + // Use sub key, if first paramenter is an array + $this->assertEquals($user->lang(array('dateformat', 'AGO'), 2), '2 seconds'); + + // ticket PHPBB3-9949 - use first int to determinate the plural-form to use $this->assertEquals($user->lang('ARRY', 1, 2), '1 post'); $this->assertEquals($user->lang('ARRY', 1, 's', 2), '1 post'); - // ticket PHPBB3-10345 + // ticket PHPBB3-10345 - different plrual rules, not just 0/1/2+ $user = new user; $user->lang = array( 'PLURAL_RULE' => 13, |