aboutsummaryrefslogtreecommitdiffstats
path: root/tests/user
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-09-21 00:36:18 +0200
committerOleg Pudeyev <oleg@bsdpower.com>2011-11-25 15:10:51 -0500
commit33e3bf4f64c3c2734bf97bcb204255cfdab37773 (patch)
tree93e84936d6361c7b44efbca949e7ecdfeafdb1f6 /tests/user
parent7da6826a671cfce61f7d92c2f5b1deafa4865872 (diff)
downloadforums-33e3bf4f64c3c2734bf97bcb204255cfdab37773.tar
forums-33e3bf4f64c3c2734bf97bcb204255cfdab37773.tar.gz
forums-33e3bf4f64c3c2734bf97bcb204255cfdab37773.tar.bz2
forums-33e3bf4f64c3c2734bf97bcb204255cfdab37773.tar.xz
forums-33e3bf4f64c3c2734bf97bcb204255cfdab37773.zip
[ticket/10345] Make the use of the 0-case optional
And correctly determinate the rule otherwise PHPBB3-10345
Diffstat (limited to 'tests/user')
-rw-r--r--tests/user/lang_test.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php
index ffc3ea1302..bf36811f89 100644
--- a/tests/user/lang_test.php
+++ b/tests/user/lang_test.php
@@ -30,6 +30,10 @@ class phpbb_user_lang_test extends phpbb_test_case
1 => '1 post', // 1
2 => '%d posts', // 0, 2+
),
+ 'ARRY_MISSING' => array(
+ 1 => '%d post', // 1
+ //Missing second plural
+ ),
'ARRY_FLOAT' => array(
1 => '1 post', // 1.x
2 => '%1$.1f posts', // 0.x, 2+.x
@@ -65,11 +69,14 @@ class phpbb_user_lang_test extends phpbb_test_case
$this->assertEquals($user->lang('ARRY', 2), '2 posts');
$this->assertEquals($user->lang('ARRY', 123), '123 posts');
- // Array with missing keys
+ // No 0 key defined
$this->assertEquals($user->lang('ARRY_NO_ZERO', 0), '0 posts');
$this->assertEquals($user->lang('ARRY_NO_ZERO', 1), '1 post');
$this->assertEquals($user->lang('ARRY_NO_ZERO', 2), '2 posts');
+ // Array with missing keys
+ $this->assertEquals($user->lang('ARRY_MISSING', 2), '2 post');
+
// Floats as array key
$this->assertEquals($user->lang('ARRY_FLOAT', 1.3), '1 post');
$this->assertEquals($user->lang('ARRY_FLOAT', 2.0), '2.0 posts');