Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 19 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_functional_extension_permission_lang_test | |
0.00% |
0 / 19 |
|
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 / 4 |
|
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_auto_include_permission_lang_from_extensions | |
0.00% |
0 / 7 |
|
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_permission_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->login(); |
| 45 | $this->admin_login(); |
| 46 | $this->add_lang('acp/permissions'); |
| 47 | } |
| 48 | |
| 49 | protected function tearDown(): void |
| 50 | { |
| 51 | $this->uninstall_ext('foo/bar'); |
| 52 | |
| 53 | parent::tearDown(); |
| 54 | } |
| 55 | |
| 56 | protected static function setup_extensions() |
| 57 | { |
| 58 | return ['foo/bar']; |
| 59 | } |
| 60 | |
| 61 | public function test_auto_include_permission_lang_from_extensions() |
| 62 | { |
| 63 | // User permissions |
| 64 | $crawler = self::request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid); |
| 65 | |
| 66 | // Select admin |
| 67 | $form = $crawler->selectButton($this->lang('SUBMIT'))->form(); |
| 68 | $data = array('username[0]' => 'admin'); |
| 69 | $form->setValues($data); |
| 70 | $crawler = self::submit($form); |
| 71 | |
| 72 | // language from language/en/acp/permissions_phpbb.php |
| 73 | $this->assertStringContainsString('Can attach files', $crawler->filter('body')->text()); |
| 74 | |
| 75 | // language from ext/foo/bar/language/en/permissions_foo.php |
| 76 | $this->assertStringContainsString('Can view foobar', $crawler->filter('body')->text()); |
| 77 | } |
| 78 | } |