From 72c3148cfef37d42b462d55813c6f41964dc72e6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 18 Jun 2012 14:59:12 +0200 Subject: [feature/new-tz-handling] Add tests for get_timestamp_from_format() PHPBB3-9558 --- tests/datetime/from_format_test.php | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/datetime/from_format_test.php (limited to 'tests/datetime') 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)); + } +} -- cgit v1.2.1