Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_functional_lang_test | |
0.00% |
0 / 8 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| test_lang | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| test_lang_missing | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| test_add_lang | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| test_add_langs | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | /** |
| 15 | * @group functional |
| 16 | */ |
| 17 | class phpbb_functional_lang_test extends phpbb_functional_test_case |
| 18 | { |
| 19 | public function test_lang() |
| 20 | { |
| 21 | // Test a language string present in the common language file |
| 22 | $this->assertEquals('Board index', $this->lang('FORUM_INDEX')); |
| 23 | } |
| 24 | |
| 25 | public function test_lang_missing() |
| 26 | { |
| 27 | $this->expectException('RuntimeException'); |
| 28 | $this->assertEquals('Your account has now been activated. Thank you for registering.', $this->lang('ACCOUNT_ACTIVE')); |
| 29 | } |
| 30 | |
| 31 | public function test_add_lang() |
| 32 | { |
| 33 | $this->add_lang('ucp'); |
| 34 | |
| 35 | // Test a language string present only in the UCP language file |
| 36 | $this->assertEquals('Your account has now been activated. Thank you for registering.', $this->lang('ACCOUNT_ACTIVE')); |
| 37 | } |
| 38 | |
| 39 | public function test_add_langs() |
| 40 | { |
| 41 | $this->add_lang(array('groups', 'memberlist')); |
| 42 | |
| 43 | // Test a language string from each UCP and memberlist |
| 44 | $this->assertEquals('The selected group is already your default group.', $this->lang('ALREADY_DEFAULT_GROUP')); |
| 45 | $this->assertEquals('Profile', $this->lang('ABOUT_USER')); |
| 46 | } |
| 47 | } |