Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
3.70% |
1 / 27 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_template_template_inheritance_test | |
3.70% |
1 / 27 |
|
50.00% |
1 / 2 |
5.57 | |
0.00% |
0 / 1 |
| template_data | |
0.00% |
0 / 26 |
|
0.00% |
0 / 1 |
2 | |||
| test_template | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 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 | require_once __DIR__ . '/template_test_case_with_tree.php'; |
| 15 | |
| 16 | class phpbb_template_template_inheritance_test extends phpbb_template_template_test_case_with_tree |
| 17 | { |
| 18 | /** |
| 19 | * @todo put test data into templates/xyz.test |
| 20 | */ |
| 21 | public static function template_data() |
| 22 | { |
| 23 | return array( |
| 24 | // First element of the array is test name - keep them distinct |
| 25 | array( |
| 26 | 'simple inheritance - only parent template exists', |
| 27 | 'parent_only.html', |
| 28 | array(), |
| 29 | array(), |
| 30 | array(), |
| 31 | "Only in parent.", |
| 32 | ), |
| 33 | array( |
| 34 | 'simple inheritance - only child template exists', |
| 35 | 'child_only.html', |
| 36 | array(), |
| 37 | array(), |
| 38 | array(), |
| 39 | "Only in child.", |
| 40 | ), |
| 41 | array( |
| 42 | 'simple inheritance - both parent and child templates exist', |
| 43 | 'parent_and_child.html', |
| 44 | array(), |
| 45 | array(), |
| 46 | array(), |
| 47 | "Child template.", |
| 48 | ), |
| 49 | ); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @dataProvider template_data |
| 54 | */ |
| 55 | public function test_template($name, $file, array $vars, array $block_vars, array $destroy, $expected) |
| 56 | { |
| 57 | $this->run_template($file, $vars, $block_vars, $destroy, $expected); |
| 58 | } |
| 59 | } |