path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( new phpbb_mock_request() ), new \phpbb\filesystem(), $phpbb_root_path, 'php' ); $this->calendar = new \board3\portal\modules\calendar(array(), null, null, null, dirname(__FILE__) . '/../../../', 'php', null, $this->path_helper); $this->offset = strtotime('17.06.1990') - 645580800; } public function data_date_to_time() { return array( array(1402855200, '2014-06-15 18:00'), array(1402855200, '15.06.2014 18:00'), array(1402855200, '06/15/2014 6:00 PM'), array(false, '15/06'), ); } /** * @dataProvider data_date_to_time */ public function test_date_to_time($expected, $date) { $this->assertEquals($expected, $this->calendar->date_to_time($date) + $this->offset); } }