Merge pull request #4230 from dokuwiki-translate/lang_update_830_1709550808
[dokuwiki.git] / _test / tests / inc / utf8_stripspecials.test.php
blob3f3ce0f56f43b18ed2342f1b04ab12ced7d3765f
1 <?php
3 class utf8_stripspecials extends DokuWikiTest
6 /**
7 * @return array
8 * @see testGivens
9 */
10 function provideGivens()
12 return [
13 ['asciistring', '', '', 'asciistring'],
14 ['asciistring', '', '\._\-:', 'asciistring'],
15 ['ascii.string', '', '\._\-:', 'asciistring'],
16 ['ascii.string', ' ', '\._\-:', 'ascii string'],
17 ['2.1.14', ' ', '\._\-:', '2 1 14'],
18 ['ascii.string', '', '\._\-:\*', 'asciistring'],
19 ['ascii.string', ' ', '\._\-:\*', 'ascii string'],
20 ['2.1.14', ' ', '\._\-:\*', '2 1 14'],
21 ['string with nbsps', '_', '\*', 'string_with_nbsps'],
22 ['αβγδεϝϛζηθικλμνξοπϟϙρστυφχψωϡ', '_', '', 'αβγδεϝϛζηθικλμνξοπϟϙρστυφχψωϡ'], // #3188
26 /**
27 * @param string $string
28 * @param string $replacement
29 * @param string $additional
30 * @param string $expected
31 * @dataProvider provideGivens
33 function testGivens($string, $replacement, $additional, $expected)
35 $this->assertEquals($expected, \dokuwiki\Utf8\Clean::stripspecials($string, $replacement, $additional));