aboutsummaryrefslogtreecommitdiffstats
path: root/tests/user/lang_test.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-11-30 21:23:00 +0100
committerJoas Schilling <nickvergessen@gmx.de>2011-11-30 21:23:00 +0100
commit65e6ab55302e5d0c30fa86e06a460fed8167b84a (patch)
tree18bee1fec71cd1b0fdc6c42cab4cac3e33a077ed /tests/user/lang_test.php
parentdd99675f7223b0fb659e4146544969e2aa978fa9 (diff)
downloadforums-65e6ab55302e5d0c30fa86e06a460fed8167b84a.tar
forums-65e6ab55302e5d0c30fa86e06a460fed8167b84a.tar.gz
forums-65e6ab55302e5d0c30fa86e06a460fed8167b84a.tar.bz2
forums-65e6ab55302e5d0c30fa86e06a460fed8167b84a.tar.xz
forums-65e6ab55302e5d0c30fa86e06a460fed8167b84a.zip
[ticket/10345] Return the language key when the key has an empty array
PHPBB3-10345
Diffstat (limited to 'tests/user/lang_test.php')
-rw-r--r--tests/user/lang_test.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php
index 36933a84d2..ee1be3c323 100644
--- a/tests/user/lang_test.php
+++ b/tests/user/lang_test.php
@@ -38,6 +38,8 @@ class phpbb_user_lang_test extends phpbb_test_case
1 => '1 post', // 1.x
2 => '%1$.1f posts', // 0.x, 2+.x
),
+ 'ARRY_EMPTY' => array(
+ ),
'dateformat' => array(
'AGO' => array(
1 => '%d second',
@@ -69,6 +71,9 @@ 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');
+ // Empty array returns the language key
+ $this->assertEquals($user->lang('ARRY_EMPTY', 123), 'ARRY_EMPTY');
+
// No 0 key defined
$this->assertEquals($user->lang('ARRY_NO_ZERO', 0), '0 posts');
$this->assertEquals($user->lang('ARRY_NO_ZERO', 1), '1 post');