mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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:
@@ -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 ) ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user