Changeset 55279 for trunk/tests/phpunit/tests/locale.php
- Timestamp:
- 02/07/2023 05:26:14 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/locale.php
r55047 r55279 174 174 $this->assertFalse( $this->locale->is_rtl() ); 175 175 } 176 177 /** 178 * Tests that `WP_Locale::get_word_count_type()` returns 179 * the appropriate value. 180 * 181 * @ticket 56698 182 * 183 * @covers WP_Locale::get_word_count_type 184 * 185 * @dataProvider data_get_word_count_type 186 * 187 * @param string $word_count_type The word count type. 188 * @param string $expected The expected return value. 189 */ 190 public function test_get_word_count_type( $word_count_type, $expected ) { 191 if ( is_string( $word_count_type ) ) { 192 $this->locale->word_count_type = $word_count_type; 193 194 } 195 196 $this->assertSame( $expected, $this->locale->get_word_count_type() ); 197 } 198 199 /** 200 * Data provider. 201 * 202 * @return array[] 203 */ 204 public function data_get_word_count_type() { 205 return array( 206 'default' => array( 207 'word_count_type' => null, 208 'expected' => 'words', 209 ), 210 'empty string' => array( 211 'word_count_type' => '', 212 'expected' => 'words', 213 ), 214 'an invalid option - "foo"' => array( 215 'word_count_type' => 'foo', 216 'expected' => 'words', 217 ), 218 'a valid option - "words"' => array( 219 'word_count_type' => 'words', 220 'expected' => 'words', 221 ), 222 'a valid option - "characters_excluding_spaces"' => array( 223 'word_count_type' => 'characters_excluding_spaces', 224 'expected' => 'characters_excluding_spaces', 225 ), 226 'a valid option - "characters_including_spaces"' => array( 227 'word_count_type' => 'characters_including_spaces', 228 'expected' => 'characters_including_spaces', 229 ), 230 ); 231 } 176 232 } 177 233
Note: See TracChangeset
for help on using the changeset viewer.