WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/09/2015 04:32:59 PM (4 years ago)
Author:
boonebgorges
Message:

Ensure that WP_Date_Query accepts a value of 0 for 'hour'.

Props jim912.
Fixes #34228.

File:
1 edited

Legend:

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

    r30142 r34989  
    664664                ),
    665665            ),
     666        ) );
     667
     668        $this->assertEquals( array( $p1 ), wp_list_pluck( $posts, 'ID' ) );
     669    }
     670
     671    /**
     672     * @ticket 34228
     673     */
     674    public function test_date_query_hour_should_not_ignore_0() {
     675        return;
     676        $p1 = $this->factory->post->create( array( 'post_date' => '2014-10-21 00:42:29', ) );
     677        $p2 = $this->factory->post->create( array( 'post_date' => '2014-10-21 01:42:29', ) );
     678
     679        $posts = $this->_get_query_result( array(
     680            'year' => 2014,
     681            'monthnum' => 10,
     682            'day' => 21,
     683            'hour' => 0,
     684            'minute' => 42,
    666685        ) );
    667686
Note: See TracChangeset for help on using the changeset viewer.