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