fix the case lookup table. #3113

This readds a whole bunch of conversions that for some reason got lost
in the refactoring. No idea what happened there.
This commit is contained in:
Andreas Gohr 2020-06-02 21:47:42 +02:00
parent 3feb137a32
commit 0884c25472
2 changed files with 548 additions and 448 deletions

View File

@ -1,23 +1,31 @@
<?php
// use no mbstring help here
if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1);
class utf8_strtolower_test extends DokuWikiTest {
class utf8_strtolower_test extends DokuWikiTest
{
function test_givens(){
$data = array(
'Αρχιτεκτονική Μελέτη' => 'αρχιτεκτονική μελέτη', // FS#2173
);
foreach($data as $input => $expected) {
$this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
}
/**
* @see testGivens
* @return array
*/
public function provideGivens()
{
return [
['Αρχιτεκτονική Μελέτη', 'αρχιτεκτονική μελέτη'], // FS#2173
['ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'],
['players:Bruce', 'players:bruce'],
['players:GERALD', 'players:gerald'],
];
}
/**
* @dataProvider provideGivens
* @param string $input
* @param string $expected
*/
public function testGivens($input, $expected)
{
$this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
// just make sure our data was correct
if(function_exists('mb_strtolower')) {
foreach($data as $input => $expected) {
$this->assertEquals($expected, mb_strtolower($input, 'utf-8'));
}
}
$this->assertEquals($expected, mb_strtolower($input, 'utf-8'), 'mbstring check');
}
}

File diff suppressed because it is too large Load Diff