MediaWiki  1.23.13
FallbackTest.php
Go to the documentation of this file.
1 <?php
2 
7 
8  public function testFallbackMbstringFunctions() {
9 
10  if ( !extension_loaded( 'mbstring' ) ) {
11  $this->markTestSkipped( "The mb_string functions must be installed to test the fallback functions" );
12  }
13 
14  $sampleUTF = "Östergötland_coat_of_arms.png";
15 
16  //mb_substr
17  $substr_params = array(
18  array( 0, 0 ),
19  array( 5, -4 ),
20  array( 33 ),
21  array( 100, -5 ),
22  array( -8, 10 ),
23  array( 1, 1 ),
24  array( 2, -1 )
25  );
26 
27  foreach ( $substr_params as $param_set ) {
28  $old_param_set = $param_set;
29  array_unshift( $param_set, $sampleUTF );
30 
31  $this->assertEquals(
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 )
35  );
36  }
37 
38  //mb_strlen
39  $this->assertEquals(
40  mb_strlen( $sampleUTF ),
41  Fallback::mb_strlen( $sampleUTF ),
42  'Fallback mb_strlen'
43  );
44 
45  //mb_str(r?)pos
46  $strpos_params = array(
47  //array( 'ter' ),
48  //array( 'Ö' ),
49  //array( 'Ö', 3 ),
50  //array( 'oat_', 100 ),
51  //array( 'c', -10 ),
52  //Broken for now
53  );
54 
55  foreach ( $strpos_params as $param_set ) {
56  $old_param_set = $param_set;
57  array_unshift( $param_set, $sampleUTF );
58 
59  $this->assertEquals(
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 )
63  );
64 
65  $this->assertEquals(
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 )
69  );
70  }
71  }
72 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
FallbackTest\testFallbackMbstringFunctions
testFallbackMbstringFunctions()
Definition: FallbackTest.php:8
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Fallback\mb_strlen
static mb_strlen( $str, $enc='')
Fallback implementation of mb_strlen, hardcoded to UTF-8.
Definition: Fallback.php:136
FallbackTest
@covers Fallback
Definition: FallbackTest.php:6
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9