Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 14 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_functional_extension_global_lang_test | |
0.00% |
0 / 14 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
| setUpBeforeClass | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| tearDownAfterClass | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setUp | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| tearDown | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setup_extensions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| test_load_extension_lang_globally | |
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_extension_global_lang_test extends phpbb_functional_test_case |
| 18 | { |
| 19 | private static $helper; |
| 20 | |
| 21 | protected static $fixtures = array( |
| 22 | './', |
| 23 | ); |
| 24 | |
| 25 | static public function setUpBeforeClass(): void |
| 26 | { |
| 27 | parent::setUpBeforeClass(); |
| 28 | |
| 29 | self::$helper = new phpbb_test_case_helpers(__CLASS__); |
| 30 | self::$helper->copy_ext_fixtures(__DIR__ . '/fixtures/ext/', self::$fixtures); |
| 31 | } |
| 32 | |
| 33 | static public function tearDownAfterClass(): void |
| 34 | { |
| 35 | parent::tearDownAfterClass(); |
| 36 | |
| 37 | self::$helper->restore_original_ext_dir(); |
| 38 | } |
| 39 | |
| 40 | protected function setUp(): void |
| 41 | { |
| 42 | parent::setUp(); |
| 43 | |
| 44 | $this->get_db(); |
| 45 | $this->purge_cache(); |
| 46 | } |
| 47 | |
| 48 | protected function tearDown(): void |
| 49 | { |
| 50 | $this->uninstall_ext('foo/bar'); |
| 51 | |
| 52 | parent::tearDown(); |
| 53 | } |
| 54 | |
| 55 | protected static function setup_extensions() |
| 56 | { |
| 57 | return ['foo/bar']; |
| 58 | } |
| 59 | |
| 60 | public function test_load_extension_lang_globally() |
| 61 | { |
| 62 | // The board index, which should contain an overwritten translation |
| 63 | $crawler = self::request('GET', 'index.php'); |
| 64 | |
| 65 | // language from language/en/common.php |
| 66 | $this->assertStringNotContainsString('Skip to content', $crawler->filter('.skiplink')->text()); |
| 67 | |
| 68 | // language from ext/foo/bar/language/en/foo_global.php |
| 69 | $this->assertStringContainsString('Overwritten by foo', $crawler->filter('.skiplink')->text()); |
| 70 | } |
| 71 | } |