xref: /dokuwiki/_test/tests/inc/utf8_strtolower.test.php (revision abe29f62bf6f821be6fd94e83404da1ff9d64d58)
1<?php
2
3class utf8_strtolower_test extends DokuWikiTest
4{
5
6    /**
7     * @see testGivens
8     * @return array
9     */
10    public function provideGivens()
11    {
12        return [
13            ['Αρχιτεκτονική Μελέτη', 'αρχιτεκτονική μελέτη'], // FS#2173
14            ['ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'],
15            ['players:Bruce', 'players:bruce'],
16            ['players:GERALD', 'players:gerald'],
17        ];
18    }
19
20    /**
21     * @dataProvider provideGivens
22     * @param string $input
23     * @param string $expected
24     */
25    public function testGivens($input, $expected)
26    {
27        $this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
28        // just make sure our data was correct
29        $this->assertEquals($expected, mb_strtolower($input, 'utf-8'), 'mbstring check');
30    }
31}
32