diff --git a/tests/datetime/from_format_test.php b/tests/datetime/from_format_test.php new file mode 100644 index 0000000000..c89a16097d --- /dev/null +++ b/tests/datetime/from_format_test.php @@ -0,0 +1,57 @@ +tz = new DateTimeZone($timezone); + $user->lang['datetime'] = array( + 'TODAY' => 'Today', + 'TOMORROW' => 'Tomorrow', + 'YESTERDAY' => 'Yesterday', + 'AGO' => array( + 0 => 'less than a minute ago', + 1 => '%d minute ago', + 2 => '%d minutes ago', + ), + ); + + $timestamp = $user->get_timestamp_from_format($format, $expected, new DateTimeZone($timezone)); + $this->assertEquals($expected, $user->format_date($timestamp, $format, true)); + } +}