Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
14.29% |
1 / 7 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_json_sanitizer_test | |
14.29% |
1 / 7 |
|
50.00% |
1 / 2 |
4.52 | |
0.00% |
0 / 1 |
| data_decode | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| test_decode_data | |
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 | use phpbb\json\sanitizer as json_sanitizer; |
| 15 | |
| 16 | class phpbb_json_sanitizer_test extends phpbb_test_case |
| 17 | { |
| 18 | public static function data_decode() |
| 19 | { |
| 20 | return [ |
| 21 | [false, []], |
| 22 | ['', []], |
| 23 | ['{ "name": "phpbb/phpbb-style-prosilver"}', ['name' => 'phpbb/phpbb-style-prosilver']], |
| 24 | ['{ "name":[[ "phpbb/phpbb-style-prosilver"}', []], |
| 25 | ]; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @dataProvider data_decode |
| 30 | */ |
| 31 | public function test_decode_data($input, $output) |
| 32 | { |
| 33 | $this->assertEquals($output, json_sanitizer::decode($input)); |
| 34 | } |
| 35 | } |