Correct the post_date
format in WP_Date_Query
tests.
It should be `'Y-m-d H:i:s'` in order to match the regex in `get_gmt_from_date()` if `'timezone_string'` option is not set. Props pbearne. Fixes #34277. git-svn-id: https://develop.svn.wordpress.org/trunk@35091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
91583fe499
commit
e85d9f1312
@ -975,8 +975,8 @@ class Tests_WP_Date_Query extends WP_UnitTestCase {
|
||||
* @ticket 31001
|
||||
*/
|
||||
public function test_validate_date_values_should_process_array_value_for_year() {
|
||||
$p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) );
|
||||
$p2 = $this->factory->post->create( array( 'post_date' => '2013-01-12' ) );
|
||||
$p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
|
||||
$p2 = $this->factory->post->create( array( 'post_date' => '2013-01-12 00:00:00' ) );
|
||||
|
||||
$q = new WP_Query( array(
|
||||
'date_query' => array(
|
||||
@ -995,8 +995,8 @@ class Tests_WP_Date_Query extends WP_UnitTestCase {
|
||||
* @ticket 31001
|
||||
*/
|
||||
public function test_validate_date_values_should_process_array_value_for_day() {
|
||||
$p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) );
|
||||
$p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10' ) );
|
||||
$p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
|
||||
$p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
|
||||
|
||||
$q = new WP_Query( array(
|
||||
'date_query' => array(
|
||||
@ -1016,8 +1016,8 @@ class Tests_WP_Date_Query extends WP_UnitTestCase {
|
||||
* @expectedIncorrectUsage WP_Date_Query
|
||||
*/
|
||||
public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() {
|
||||
$p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) );
|
||||
$p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10' ) );
|
||||
$p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
|
||||
$p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
|
||||
|
||||
$q = new WP_Query( array(
|
||||
'date_query' => array(
|
||||
|
Loading…
Reference in New Issue
Block a user