WordPress.org

Make WordPress Core

Changeset 35091


Ignore:
Timestamp:
10/12/2015 11:39:50 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/query.php

    r34989 r35091  
    976976     */
    977977    public function test_validate_date_values_should_process_array_value_for_year() {
    978         $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) );
    979         $p2 = $this->factory->post->create( array( 'post_date' => '2013-01-12' ) );
     978        $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     979        $p2 = $this->factory->post->create( array( 'post_date' => '2013-01-12 00:00:00' ) );
    980980
    981981        $q = new WP_Query( array(
     
    996996     */
    997997    public function test_validate_date_values_should_process_array_value_for_day() {
    998         $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) );
    999         $p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10' ) );
     998        $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     999        $p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
    10001000
    10011001        $q = new WP_Query( array(
     
    10171017     */
    10181018    public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() {
    1019         $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) );
    1020         $p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10' ) );
     1019        $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     1020        $p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
    10211021
    10221022        $q = new WP_Query( array(
Note: See TracChangeset for help on using the changeset viewer.