Changeset 39167
- Timestamp:
- 11/08/2016 10:31:51 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/date/dateI18n.php
r39013 r39167 23 23 24 24 public function test_custom_timezone_setting() { 25 update_option( 'timezone_string', ' Europe/Zurich' );25 update_option( 'timezone_string', 'America/Regina' ); 26 26 27 27 $this->assertEquals( strtotime( date( 'Y-m-d H:i:s', time() + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ), strtotime( date_i18n( 'Y-m-d H:i:s' ) ), 'The dates should be equal', 2 ); … … 29 29 30 30 public function test_date_should_be_in_gmt_with_custom_timezone_setting() { 31 update_option( 'timezone_string', ' Europe/Zurich' );31 update_option( 'timezone_string', 'America/Regina' ); 32 32 33 33 $this->assertEquals( strtotime( date( 'Y-m-d H:i:s' ) ), strtotime( date_i18n( 'Y-m-d H:i:s', false, true ) ), 'The dates should be equal', 2 ); … … 35 35 36 36 public function test_date_should_be_in_gmt_with_custom_timezone_setting_and_timestamp() { 37 update_option( 'timezone_string', ' Europe/Zurich' );37 update_option( 'timezone_string', 'America/Regina' ); 38 38 39 39 $this->assertEquals( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) ); … … 64 64 65 65 public function test_adjusts_format_based_on_timezone_string() { 66 update_option( 'timezone_string', ' Europe/Zurich' );66 update_option( 'timezone_string', 'America/Regina' ); 67 67 68 $this->assertEquals( '2012-12-01 00:00:00 C ET +01:00 Europe/Zurich', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) );68 $this->assertEquals( '2012-12-01 00:00:00 CST -06:00 America/Regina', date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2012-12-01 00:00:00' ) ) ); 69 69 } 70 70 }
Note: See TracChangeset
for help on using the changeset viewer.