Changeset 55562 for trunk/tests/phpunit/tests/date/wpTimezone.php
- Timestamp:
- 03/19/2023 12:03:30 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/date/wpTimezone.php
r54230 r55562 23 23 * @ticket 24730 24 24 * 25 * @dataProvider timezone_offset_provider25 * @dataProvider data_should_convert_gmt_offset 26 26 * 27 27 * @param float $gmt_offset Numeric offset from UTC. … … 40 40 41 41 /** 42 * @ticket 2473043 */44 public function test_should_return_timezone_string() {45 update_option( 'timezone_string', 'Europe/Helsinki' );46 47 $this->assertSame( 'Europe/Helsinki', wp_timezone_string() );48 49 $timezone = wp_timezone();50 51 $this->assertSame( 'Europe/Helsinki', $timezone->getName() );52 }53 54 /**55 * Ensures that deprecated timezone strings are handled correctly.56 *57 * @ticket 5646858 */59 public function test_should_return_deprecated_timezone_string() {60 $tz_string = 'America/Buenos_Aires'; // This timezone was deprecated pre-PHP 5.6.61 update_option( 'timezone_string', $tz_string );62 63 $this->assertSame( $tz_string, wp_timezone_string() );64 65 $timezone = wp_timezone();66 67 $this->assertSame( $tz_string, $timezone->getName() );68 }69 70 /**71 42 * Data provider to test numeric offset conversion. 72 43 * 73 44 * @return array 74 45 */ 75 public function timezone_offset_provider() {46 public function data_should_convert_gmt_offset() { 76 47 return array( 77 48 array( -12, '-12:00' ), … … 135 106 ); 136 107 } 108 109 /** 110 * @ticket 24730 111 */ 112 public function test_should_return_timezone_string() { 113 update_option( 'timezone_string', 'Europe/Helsinki' ); 114 115 $this->assertSame( 'Europe/Helsinki', wp_timezone_string() ); 116 117 $timezone = wp_timezone(); 118 119 $this->assertSame( 'Europe/Helsinki', $timezone->getName() ); 120 } 121 122 /** 123 * Ensures that deprecated timezone strings are handled correctly. 124 * 125 * @ticket 56468 126 */ 127 public function test_should_return_deprecated_timezone_string() { 128 $tz_string = 'America/Buenos_Aires'; // This timezone was deprecated pre-PHP 5.6. 129 update_option( 'timezone_string', $tz_string ); 130 131 $this->assertSame( $tz_string, wp_timezone_string() ); 132 133 $timezone = wp_timezone(); 134 135 $this->assertSame( $tz_string, $timezone->getName() ); 136 } 137 137 }
Note: See TracChangeset
for help on using the changeset viewer.