Make WordPress Core


Ignore:
Timestamp:
01/20/2015 07:12:48 PM (12 years ago)
Author:
boonebgorges
Message:

WP_Date_Query date validation should not fail for hour = 0.

Props ChriCo, tyxla.
Fixes #31067 for trunk.

File:
1 edited

Legend:

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

    r31179 r31251  
    858858        public function test_validate_date_values_hour() {
    859859                // Valid values.
    860                 $hours = range( 1, 23 );
     860                $hours = range( 0, 23 );
    861861                foreach ( $hours as $hour ) {
    862862                        $this->assertTrue( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
    … …  
    864864
    865865                // Invalid values.
    866                 $hours = array( -1, 24, 25, 'string who wants to be a int' );
     866                $hours = array( -1, 24, 25, 'string' );
    867867                foreach ( $hours as $hour ) {
    868868                        $this->assertFalse( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
Note: See TracChangeset for help on using the changeset viewer.