xref: /dokuwiki/_test/tests/inc/utf8_strtolower.test.php (revision 8cbc5ee84fe788597ede5266255a74af6da47555)
104180aa9SAndreas Gohr<?php
204180aa9SAndreas Gohr// use no mbstring help here
304180aa9SAndreas Gohrif(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
404180aa9SAndreas Gohr
504180aa9SAndreas Gohrclass utf8_strtolower_test extends DokuWikiTest {
604180aa9SAndreas Gohr
704180aa9SAndreas Gohr    function test_givens(){
804180aa9SAndreas Gohr        $data = array(
904180aa9SAndreas Gohr            'Αρχιτεκτονική Μελέτη' => 'αρχιτεκτονική μελέτη', // FS#2173
1004180aa9SAndreas Gohr        );
1104180aa9SAndreas Gohr
1204180aa9SAndreas Gohr        foreach($data as $input => $expected) {
13*8cbc5ee8SAndreas Gohr            $this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
1404180aa9SAndreas Gohr        }
1504180aa9SAndreas Gohr
1604180aa9SAndreas Gohr        // just make sure our data was correct
1704180aa9SAndreas Gohr        if(function_exists('mb_strtolower')) {
1804180aa9SAndreas Gohr            foreach($data as $input => $expected) {
1904180aa9SAndreas Gohr                $this->assertEquals($expected, mb_strtolower($input, 'utf-8'));
2004180aa9SAndreas Gohr            }
2104180aa9SAndreas Gohr        }
2204180aa9SAndreas Gohr    }
2304180aa9SAndreas Gohr}
24