getName()); date_default_timezone_set(static::$server_tz); unset($GLOBALS['egw']); parent::tearDownAfterClass(); } /** * Test the widget's basic functionality - we put data in, it comes back * unchanged. * * @dataProvider basicProvider */ public function testBasic($content, $expected) { // Instanciate the template\ $etemplate = new Etemplate(); $etemplate->read(static::TEST_TEMPLATE, 'test'); $result = $this->mockedRoundTrip($etemplate, $content); $this->validateTest($result, $expected ? $expected : $content); } public function basicProvider() { $now = new DateTime(time()); $now->setTime(22, 13, 20); // Just because 80000 seconds after epoch is 22:13:20 $today = clone $now; $today->setTime(0,0); $time = new DateTime(80000); // 22:13:20 $data = array( array( array('date' => $today->getTimestamp(), 'date_time' => $today->getTimestamp()), false ), array( // Timestamp in a date field gets adjusted to day start, timeonly is epoch array('date' => $now->getTimestamp(), 'date_time' => $now->getTimestamp(), 'date_timeonly' => $now->getTimestamp()), array('date' => $now->getTimestamp(), 'date_time' => $now->getTimestamp(), 'date_timeonly' => $time->getTimestamp()) ) ); return $data; } }