mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group formatting
|
||||
* @group datetime
|
||||
*/
|
||||
class Tests_Formatting_Date extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* Unpatched, this test passes only when Europe/London is not observing DST.
|
||||
*
|
||||
* @ticket 20328
|
||||
*/
|
||||
function test_get_date_from_gmt_outside_of_dst() {
|
||||
update_option( 'timezone_string', 'Europe/London' );
|
||||
$gmt = $local = '2012-01-01 12:34:56';
|
||||
$this->assertEquals( $local, get_date_from_gmt( $gmt ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpatched, this test passes only when Europe/London is observing DST.
|
||||
*
|
||||
* @ticket 20328
|
||||
*/
|
||||
function test_get_date_from_gmt_during_dst() {
|
||||
update_option( 'timezone_string', 'Europe/London' );
|
||||
$gmt = '2012-06-01 12:34:56';
|
||||
$local = '2012-06-01 13:34:56';
|
||||
$this->assertEquals( $local, get_date_from_gmt( $gmt ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 20328
|
||||
*/
|
||||
function test_get_gmt_from_date_outside_of_dst() {
|
||||
update_option( 'timezone_string', 'Europe/London' );
|
||||
$local = $gmt = '2012-01-01 12:34:56';
|
||||
$this->assertEquals( $gmt, get_gmt_from_date( $local ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 20328
|
||||
*/
|
||||
function test_get_gmt_from_date_during_dst() {
|
||||
update_option( 'timezone_string', 'Europe/London' );
|
||||
$local = '2012-06-01 12:34:56';
|
||||
$gmt = '2012-06-01 11:34:56';
|
||||
$this->assertEquals( $gmt, get_gmt_from_date( $local ) );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user