Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
16.67% |
1 / 6 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_utf_utf8_clean_string_test | |
16.67% |
1 / 6 |
|
50.00% |
1 / 2 |
4.31 | |
0.00% |
0 / 1 |
| cleanable_strings | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| test_utf8_clean_string | |
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 | class phpbb_utf_utf8_clean_string_test extends phpbb_test_case |
| 15 | { |
| 16 | public static function cleanable_strings() |
| 17 | { |
| 18 | return array( |
| 19 | array('MiXed CaSe', 'mixed case', 'Checking case folding'), |
| 20 | array(' many spaces ', 'many spaces', 'Checking whitespace reduction'), |
| 21 | array("we\xC2\xA1rd\xE1\x9A\x80ch\xCE\xB1r\xC2\xADacters", 'weird characters', 'Checking confusables replacement'), |
| 22 | ); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @dataProvider cleanable_strings |
| 27 | */ |
| 28 | public function test_utf8_clean_string($input, $output, $label) |
| 29 | { |
| 30 | $this->assertEquals($output, utf8_clean_string($input), $label); |
| 31 | } |
| 32 | } |
| 33 |