Changeset 55036
- Timestamp:
- 01/07/2023 12:36:22 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/compat/mbStrlen.php
r54064 r55036 20 20 * @dataProvider utf8_string_lengths 21 21 */ 22 public function test_mb_strlen( $ string, $expected_character_length ) {23 $this->assertSame( $expected_character_length, _mb_strlen( $ string, 'UTF-8' ) );22 public function test_mb_strlen( $input_string, $expected_character_length ) { 23 $this->assertSame( $expected_character_length, _mb_strlen( $input_string, 'UTF-8' ) ); 24 24 } 25 25 … … 27 27 * @dataProvider utf8_string_lengths 28 28 */ 29 public function test_mb_strlen_via_regex( $ string, $expected_character_length ) {29 public function test_mb_strlen_via_regex( $input_string, $expected_character_length ) { 30 30 _wp_can_use_pcre_u( false ); 31 $this->assertSame( $expected_character_length, _mb_strlen( $ string, 'UTF-8' ) );31 $this->assertSame( $expected_character_length, _mb_strlen( $input_string, 'UTF-8' ) ); 32 32 _wp_can_use_pcre_u( 'reset' ); 33 33 } … … 36 36 * @dataProvider utf8_string_lengths 37 37 */ 38 public function test_8bit_mb_strlen( $ string, $expected_character_length, $expected_byte_length ) {39 $this->assertSame( $expected_byte_length, _mb_strlen( $ string, '8bit' ) );38 public function test_8bit_mb_strlen( $input_string, $expected_character_length, $expected_byte_length ) { 39 $this->assertSame( $expected_byte_length, _mb_strlen( $input_string, '8bit' ) ); 40 40 } 41 41 … … 48 48 return array( 49 49 array( 50 ' string'=> 'баба',50 'input_string' => 'баба', 51 51 'expected_character_length' => 4, 52 52 'expected_byte_length' => 8, 53 53 ), 54 54 array( 55 ' string'=> 'баб',55 'input_string' => 'баб', 56 56 'expected_character_length' => 3, 57 57 'expected_byte_length' => 6, 58 58 ), 59 59 array( 60 ' string'=> 'I am your б',60 'input_string' => 'I am your б', 61 61 'expected_character_length' => 11, 62 62 'expected_byte_length' => 12, 63 63 ), 64 64 array( 65 ' string'=> '1111111111',65 'input_string' => '1111111111', 66 66 'expected_character_length' => 10, 67 67 'expected_byte_length' => 10, 68 68 ), 69 69 array( 70 ' string'=> '²²²²²²²²²²',70 'input_string' => '²²²²²²²²²²', 71 71 'expected_character_length' => 10, 72 72 'expected_byte_length' => 20, 73 73 ), 74 74 array( 75 ' string'=> '3333333333',75 'input_string' => '3333333333', 76 76 'expected_character_length' => 10, 77 77 'expected_byte_length' => 30, 78 78 ), 79 79 array( 80 ' string'=> '𝟜𝟜𝟜𝟜𝟜𝟜𝟜𝟜𝟜𝟜',80 'input_string' => '𝟜𝟜𝟜𝟜𝟜𝟜𝟜𝟜𝟜𝟜', 81 81 'expected_character_length' => 10, 82 82 'expected_byte_length' => 40, 83 83 ), 84 84 array( 85 ' string'=> '1²3𝟜1²3𝟜1²3𝟜',85 'input_string' => '1²3𝟜1²3𝟜1²3𝟜', 86 86 'expected_character_length' => 12, 87 87 'expected_byte_length' => 30,
Note: See TracChangeset
for help on using the changeset viewer.