update timezone unit tests to support WP 5.3/5.4
This commit is contained in:
parent
7fbe912e19
commit
1215844b05
|
@ -699,15 +699,15 @@ class WC_Tests_Formatting_Functions extends WC_Unit_Test_Case {
|
|||
|
||||
// Test with missing UTC offset.
|
||||
delete_option( 'gmt_offset' );
|
||||
$this->assertEquals( '+00:00', wc_timezone_string() );
|
||||
$this->assertContains( wc_timezone_string(), array( '+00:00', 'UTC' ) );
|
||||
|
||||
// Test with manually set UTC offset.
|
||||
update_option( 'gmt_offset', -4 );
|
||||
$this->assertNotEquals( 'UTC', wc_timezone_string() );
|
||||
$this->assertNotContains( wc_timezone_string(), array( '+00:00', 'UTC' ) );
|
||||
|
||||
// Test with invalid offset.
|
||||
update_option( 'gmt_offset', 'invalid' );
|
||||
$this->assertEquals( '+00:00', wc_timezone_string() );
|
||||
$this->assertContains( wc_timezone_string(), array( '+00:00', 'UTC' ) );
|
||||
|
||||
// Restore default.
|
||||
update_option( 'gmt_offset', '0' );
|
||||
|
|
Loading…
Reference in New Issue