From e85d9f1312135f3fa84daac624c1ed285211d824 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 12 Oct 2015 23:39:50 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/date/query.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/date/query.php b/tests/phpunit/tests/date/query.php index 3ce905a291..99c6ca5389 100644 --- a/tests/phpunit/tests/date/query.php +++ b/tests/phpunit/tests/date/query.php @@ -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(