From b82c77b38f69aa2d8030ee848042a0169592878b Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 24 Apr 2012 14:10:50 -0400 Subject: [PATCH] [task/functional] Make sure missing language values are handled properly PHPBB3-10758 --- tests/functional/lang_test.php | 8 ++++++++ tests/test_framework/phpbb_functional_test_case.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/functional/lang_test.php b/tests/functional/lang_test.php index f77dd511a3..053806a431 100644 --- a/tests/functional/lang_test.php +++ b/tests/functional/lang_test.php @@ -18,6 +18,14 @@ class phpbb_functional_lang_test extends phpbb_functional_test_case $this->assertEquals('Board index', $this->lang('FORUM_INDEX')); } + /** + * @expectedException RuntimeException + */ + public function test_lang_missing() + { + $this->assertEquals('Your account has now been activated. Thank you for registering.', $this->lang('ACCOUNT_ACTIVE')); + } + public function test_add_lang() { $this->add_lang('ucp'); diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index f14e214a78..177f93cf3b 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -229,7 +229,7 @@ class phpbb_functional_test_case extends phpbb_test_case if (empty($this->lang[$key])) { - throw new Exception('Language key "' . $key . '" could not be found.'); + throw new RuntimeException('Language key "' . $key . '" could not be found.'); } $args[0] = $this->lang[$key];