Example #1
0
 /**
  * test conversion from local date+time to DB date+time, no TZ handling
  * @dataProvider dateTestSet
  */
 public function testToDbDateTimeFormats($db, $df, $tf, $tz, $display, $dbdate)
 {
     $tf = empty($tf) ? self::DEFAULT_TIME_FORMAT : $tf;
     $this->_setPrefs($df, $tf, $tz);
     $dt = explode(' ', $display);
     if (count($dt) > 1) {
         list($date, $time) = $dt;
     } else {
         $date = $dt[0];
         $z = new DateTime("@0", new DateTimeZone("GMT"));
         $time = $z->format($tf);
     }
     $this->assertEquals(explode(' ', $dbdate), $this->time_date->to_db_date_time($date, $time), "Broken conversion for '{$df} {$tf}' with date '{$display}' and TZ {$tz}");
 }