diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index c6542d62d9..ce45499d0c 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -797,7 +797,8 @@ function wp_get_http_headers( $url, $deprecated = false ) { */ function is_new_day() { global $currentday, $previousday; - if ( $currentday != $previousday ) { + + if ( $currentday !== $previousday ) { return 1; } else { return 0; diff --git a/tests/phpunit/tests/functions/isNewDay.php b/tests/phpunit/tests/functions/isNewDay.php new file mode 100644 index 0000000000..629a6d3de5 --- /dev/null +++ b/tests/phpunit/tests/functions/isNewDay.php @@ -0,0 +1,36 @@ +assertSame( $expected, is_new_day() ); + } + + public function _data_is_new_date() { + return array( + array( '21.05.19', '21.05.19', 0 ), + array( '21.05.19', '20.05.19', 1 ), + array( '21.05.19', false, 1 ), + ); + } + +}