Changeset 55047 for trunk/tests/phpunit/tests/locale.php
- Timestamp:
- 01/10/2023 01:59:00 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/locale.php
r53866 r55047 14 14 parent::set_up(); 15 15 $this->locale = new WP_Locale(); 16 } 17 18 /** 19 * @ticket 57427 20 * 21 * @dataProvider data_property_initializes_to_array 22 * 23 * @param string $name Property name to test. 24 */ 25 public function test_property_initializes_to_array( $name ) { 26 $this->assertIsArray( $this->locale->$name, "WP_Locale::{$name} property should be an array" ); 27 28 // Test a custom implementation when `init()` is not invoked in the constructor. 29 $wp_locale = new Custom_WP_Locale(); 30 $this->assertIsArray( $wp_locale->$name, "Custom_WP_Locale::{$name} property should be an array" ); 31 } 32 33 /** 34 * Data provider. 35 * 36 * @return array 37 */ 38 public function data_property_initializes_to_array() { 39 return array( 40 'weekday' => array( 'weekday' ), 41 'weekday_initial' => array( 'weekday_initial' ), 42 'weekday_abbrev' => array( 'weekday_abbrev' ), 43 'month' => array( 'month' ), 44 'month_genitive' => array( 'month_genitive' ), 45 'month_abbrev' => array( 'month_abbrev' ), 46 'meridiem' => array( 'meridiem' ), 47 'number_format' => array( 'number_format' ), 48 ); 16 49 } 17 50 … … 142 175 } 143 176 } 177 178 class Custom_WP_Locale extends WP_Locale { 179 public function __construct() { 180 // Do not initialize to test property initialization. 181 // $this->init(); 182 $this->register_globals(); 183 } 184 }
Note: See TracChangeset
for help on using the changeset viewer.