WP_Date_Query date validation should not fail for hour = 0.

Props ChriCo, tyxla.
Fixes #31067 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@31251 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-01-20 19:12:48 +00:00
parent 37ea642f69
commit f1771073dc
2 changed files with 4 additions and 4 deletions

View File

@@ -857,13 +857,13 @@ class Tests_WP_Date_Query extends WP_UnitTestCase {
*/
public function test_validate_date_values_hour() {
// Valid values.
$hours = range( 1, 23 );
$hours = range( 0, 23 );
foreach ( $hours as $hour ) {
$this->assertTrue( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
}
// Invalid values.
$hours = array( -1, 24, 25, 'string who wants to be a int' );
$hours = array( -1, 24, 25, 'string' );
foreach ( $hours as $hour ) {
$this->assertFalse( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
}