You appear to be a bot. Output may be restricted
Description
Usage
Tests_WP_Date_Query::test_build_mysql_datetime_with_relative_date();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/date/query.php
Lines:
1 to 13 of 13
public function test_build_mysql_datetime_with_relative_date() { update_option( 'timezone_string', 'Europe/Kiev' ); $q = new WP_Date_Query( array() ); $yesterday = new DateTimeImmutable( '-1 day', wp_timezone() ); $expected = $yesterday->format( 'Y-m-d H:i:s' ); $found = $q->build_mysql_datetime( '-1 day' ); $message = "Expected {$expected}, got {$found}"; $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 ); }