Changeset 48937 for trunk/tests/phpunit/tests/formatting/RemoveAccents.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/RemoveAccents.php
r47122 r48937 6 6 class Tests_Formatting_RemoveAccents extends WP_UnitTestCase { 7 7 public function test_remove_accents_simple() { 8 $this->assert Equals( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) );8 $this->assertSame( 'abcdefghijkl', remove_accents( 'abcdefghijkl' ) ); 9 9 } 10 10 … … 16 16 $output = 'aoAAAAAAAECEEEEIIIIDNOOOOOOUUUUYTHsaaaaaaaeceeeeiiiidnoooooouuuuythy'; 17 17 18 $this->assert Equals( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' );18 $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin-1 Supplement' ); 19 19 } 20 20 … … 23 23 $output = 'AaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiIJijJjKkkLlLlLlLlLlNnNnNnnNnOoOoOoOEoeRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzs'; 24 24 25 $this->assert Equals( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' );25 $this->assertSame( $output, remove_accents( $input ), 'remove_accents replaces Latin Extended A' ); 26 26 } 27 27 28 28 public function test_remove_accents_latin_extended_b() { 29 $this->assert Equals( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' );29 $this->assertSame( 'SsTt', remove_accents( 'ȘșȚț' ), 'remove_accents replaces Latin Extended B' ); 30 30 } 31 31 32 32 public function test_remove_accents_euro_pound_signs() { 33 $this->assert Equals( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' );34 $this->assert Equals( '', remove_accents( '£' ), 'remove_accents replaces pound sign' );33 $this->assertSame( 'E', remove_accents( '€' ), 'remove_accents replaces euro sign' ); 34 $this->assertSame( '', remove_accents( '£' ), 'remove_accents replaces pound sign' ); 35 35 } 36 36 … … 42 42 $output = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyyOEoeAEDHTHssaedhth'; 43 43 44 $this->assert Equals( $output, remove_accents( $input ), 'remove_accents from ISO-8859-1 text' );44 $this->assertSame( $output, remove_accents( $input ), 'remove_accents from ISO-8859-1 text' ); 45 45 } 46 46 … … 51 51 // Vowels with diacritic. 52 52 // Unmarked. 53 $this->assert Equals( 'OoUu', remove_accents( 'ƠơƯư' ) );53 $this->assertSame( 'OoUu', remove_accents( 'ƠơƯư' ) ); 54 54 // Grave accent. 55 $this->assert Equals( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) );55 $this->assertSame( 'AaAaEeOoOoUuYy', remove_accents( 'ẦầẰằỀềỒồỜờỪừỲỳ' ) ); 56 56 // Hook. 57 $this->assert Equals( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) );57 $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẢảẨẩẲẳẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ' ) ); 58 58 // Tilde. 59 $this->assert Equals( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) );59 $this->assertSame( 'AaAaEeEeOoOoUuYy', remove_accents( 'ẪẫẴẵẼẽỄễỖỗỠỡỮữỸỹ' ) ); 60 60 // Acute accent. 61 $this->assert Equals( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) );61 $this->assertSame( 'AaAaEeOoOoUu', remove_accents( 'ẤấẮắẾếỐốỚớỨứ' ) ); 62 62 // Dot below. 63 $this->assert Equals( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) );63 $this->assertSame( 'AaAaAaEeEeIiOoOoOoUuUuYy', remove_accents( 'ẠạẬậẶặẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' ) ); 64 64 } 65 65 … … 70 70 // Vowels with diacritic (Chinese, Hanyu Pinyin). 71 71 // Macron. 72 $this->assert Equals( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) );72 $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'āēīōūǖĀĒĪŌŪǕ' ) ); 73 73 // Acute accent. 74 $this->assert Equals( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) );74 $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'áéíóúǘÁÉÍÓÚǗ' ) ); 75 75 // Caron. 76 $this->assert Equals( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) );76 $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'ǎěǐǒǔǚǍĚǏǑǓǙ' ) ); 77 77 // Grave accent. 78 $this->assert Equals( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) );78 $this->assertSame( 'aeiouuAEIOUU', remove_accents( 'àèìòùǜÀÈÌÒÙǛ' ) ); 79 79 // Unmarked. 80 $this->assert Equals( 'aaeiouuAEIOUU', remove_accents( 'aɑeiouüAEIOUÜ' ) );80 $this->assertSame( 'aaeiouuAEIOUU', remove_accents( 'aɑeiouüAEIOUÜ' ) ); 81 81 } 82 82 … … 91 91 add_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) ); 92 92 93 $this->assert Equals( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) );93 $this->assertSame( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß' ) ); 94 94 95 95 remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) ); … … 106 106 add_filter( 'locale', array( $this, '_set_locale_to_danish' ) ); 107 107 108 $this->assert Equals( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );108 $this->assertSame( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) ); 109 109 110 110 remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) ); … … 121 121 add_filter( 'locale', array( $this, '_set_locale_to_catalan' ) ); 122 122 123 $this->assert Equals( 'allallalla', remove_accents( 'al·lallaŀla' ) );123 $this->assertSame( 'allallalla', remove_accents( 'al·lallaŀla' ) ); 124 124 125 125 remove_filter( 'locale', array( $this, '_set_locale_to_catalan' ) ); 126 126 127 $this->assert Equals( 'al·lallalla', remove_accents( 'al·lallaŀla' ) );127 $this->assertSame( 'al·lallalla', remove_accents( 'al·lallaŀla' ) ); 128 128 } 129 129 … … 138 138 add_filter( 'locale', array( $this, '_set_locale_to_serbian' ) ); 139 139 140 $this->assert Equals( 'DJdj', remove_accents( 'Đđ' ) );140 $this->assertSame( 'DJdj', remove_accents( 'Đđ' ) ); 141 141 142 142 remove_filter( 'locale', array( $this, '_set_locale_to_serbian' ) ); 143 143 144 $this->assert Equals( 'Dd', remove_accents( 'Đđ' ) );144 $this->assertSame( 'Dd', remove_accents( 'Đđ' ) ); 145 145 } 146 146 }
Note: See TracChangeset
for help on using the changeset viewer.