Changeset 55037
- Timestamp:
- 01/08/2023 01:13:59 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/compat/mbSubstr.php
r54064 r55037 20 20 * @dataProvider utf8_substrings 21 21 */ 22 public function test_mb_substr( $ string, $start, $length, $expected_character_substring ) {23 $this->assertSame( $expected_character_substring, _mb_substr( $ string, $start, $length, 'UTF-8' ) );22 public function test_mb_substr( $input_string, $start, $length, $expected_character_substring ) { 23 $this->assertSame( $expected_character_substring, _mb_substr( $input_string, $start, $length, 'UTF-8' ) ); 24 24 } 25 25 … … 27 27 * @dataProvider utf8_substrings 28 28 */ 29 public function test_mb_substr_via_regex( $ string, $start, $length, $expected_character_substring ) {29 public function test_mb_substr_via_regex( $input_string, $start, $length, $expected_character_substring ) { 30 30 _wp_can_use_pcre_u( false ); 31 $this->assertSame( $expected_character_substring, _mb_substr( $ string, $start, $length, 'UTF-8' ) );31 $this->assertSame( $expected_character_substring, _mb_substr( $input_string, $start, $length, 'UTF-8' ) ); 32 32 _wp_can_use_pcre_u( 'reset' ); 33 33 } … … 36 36 * @dataProvider utf8_substrings 37 37 */ 38 public function test_8bit_mb_substr( $ string, $start, $length, $expected_character_substring, $expected_byte_substring ) {39 $this->assertSame( $expected_byte_substring, _mb_substr( $ string, $start, $length, '8bit' ) );38 public function test_8bit_mb_substr( $input_string, $start, $length, $expected_character_substring, $expected_byte_substring ) { 39 $this->assertSame( $expected_byte_substring, _mb_substr( $input_string, $start, $length, '8bit' ) ); 40 40 } 41 41 … … 48 48 return array( 49 49 array( 50 ' string'=> 'баба',50 'input_string' => 'баба', 51 51 'start' => 0, 52 52 'length' => 3, … … 55 55 ), 56 56 array( 57 ' string'=> 'баба',57 'input_string' => 'баба', 58 58 'start' => 0, 59 59 'length' => -1, … … 62 62 ), 63 63 array( 64 ' string'=> 'баба',64 'input_string' => 'баба', 65 65 'start' => 1, 66 66 'length' => null, … … 69 69 ), 70 70 array( 71 ' string'=> 'баба',71 'input_string' => 'баба', 72 72 'start' => -3, 73 73 'length' => null, … … 76 76 ), 77 77 array( 78 ' string'=> 'баба',78 'input_string' => 'баба', 79 79 'start' => -3, 80 80 'length' => 2, … … 83 83 ), 84 84 array( 85 ' string'=> 'баба',85 'input_string' => 'баба', 86 86 'start' => -1, 87 87 'length' => 2, … … 90 90 ), 91 91 array( 92 ' string'=> 'I am your баба',92 'input_string' => 'I am your баба', 93 93 'start' => 0, 94 94 'length' => 11,
Note: See TracChangeset
for help on using the changeset viewer.