timezone = 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)); } }