| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
o |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
class LanguageTrTest extends LanguageClassesTestCase { |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
public function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) { |
| 26 |
if ( $func == 'ucfirst' ) { |
| 27 |
$res = $this->getLang()->ucfirst( $input ); |
| 28 |
} elseif ( $func == 'lcfirst' ) { |
| 29 |
$res = $this->getLang()->lcfirst( $input ); |
| 30 |
} else { |
| 31 |
throw new InvalidArgumentException( __METHOD__ . " given an invalid function name '$func'" ); |
| 32 |
} |
| 33 |
|
| 34 |
$msg = "Converting $inputCase case '$input' with $func should give '$expected'"; |
| 35 |
|
| 36 |
$this->assertEquals( $expected, $res, $msg ); |
| 37 |
} |
| 38 |
|
| 39 |
public static function provideDottedAndDotlessI() { |
| 40 |
return [ |
| 41 |
|
| 42 |
|
| 43 |
[ 'ucfirst', 'ı', 'lower', 'I' ], |
| 44 |
[ 'ucfirst', 'i', 'lower', 'İ' ], |
| 45 |
[ 'lcfirst', 'I', 'upper', 'ı' ], |
| 46 |
[ 'lcfirst', 'İ', 'upper', 'i' ], |
| 47 |
|
| 48 |
|
| 49 |
[ 'ucfirst', 'I', 'upper', 'I' ], |
| 50 |
[ 'ucfirst', 'İ', 'upper', 'İ' ], |
| 51 |
[ 'lcfirst', 'ı', 'lower', 'ı' ], |
| 52 |
[ 'lcfirst', 'i', 'lower', 'i' ], |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
[ 'lcfirst', 'iPhone', 'lower', 'iPhone' ], |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
[ 'lcfirst', 'IPhone', 'upper', 'ıPhone' ], |
| 61 |
|
| 62 |
]; |
| 63 |
} |
| 64 |
} |