6 class FallbackTest
extends MediaWikiTestCase
{
7 public function testFallbackMbstringFunctions() {
8 if ( !extension_loaded( 'mbstring' ) ) {
9 $this->markTestSkipped(
10 "The mb_string functions must be installed to test the fallback functions"
14 $sampleUTF = "Östergötland_coat_of_arms.png";
17 $substr_params = array(
27 foreach ( $substr_params as $param_set ) {
28 $old_param_set = $param_set;
29 array_unshift( $param_set, $sampleUTF );
32 call_user_func_array( 'mb_substr', $param_set ),
33 call_user_func_array( 'Fallback::mb_substr', $param_set ),
34 'Fallback mb_substr with params ' . implode( ', ', $old_param_set )
40 mb_strlen( $sampleUTF ),
41 Fallback
::mb_strlen( $sampleUTF ),
46 $strpos_params = array(
50 //array( 'oat_', 100 ),
55 foreach ( $strpos_params as $param_set ) {
56 $old_param_set = $param_set;
57 array_unshift( $param_set, $sampleUTF );
60 call_user_func_array( 'mb_strpos', $param_set ),
61 call_user_func_array( 'Fallback::mb_strpos', $param_set ),
62 'Fallback mb_strpos with params ' . implode( ', ', $old_param_set )
66 call_user_func_array( 'mb_strrpos', $param_set ),
67 call_user_func_array( 'Fallback::mb_strrpos', $param_set ),
68 'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set )