Make WordPress Core

Ticket #31067: 31067.2.patch

File 31067.2.patch, 751 bytes (added by tyxla, 10 years ago)

Updating test_validate_date_values_hour() unit test to support 0 as a valid hour value. Removing the string from invalid value checks, as a string will evaluate as 0, which is now actually a valid value.

  • tests/phpunit/tests/date/query.php

     
    857857         */
    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 ) ) );
    863863                }
    864864
    865865                // Invalid values.
    866                 $hours = array( -1, 24, 25, 'string who wants to be a int' );
     866                $hours = array( -1, 24, 25 );
    867867                foreach ( $hours as $hour ) {
    868868                        $this->assertFalse( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
    869869                }