Пример #1
0
 public function testCompareTimezoneOffsets()
 {
     $config = Config::getInstance();
     $config->setValue('timezone', 'Europe/London');
     $timezone = $config->getValue('timezone');
     $time = new DateTime("now", new DateTimeZone($timezone));
     $tz_config = $time->format('P');
     //destroy the existing PDO connection which gets established in setUp to start with a clean slate
     TestMySQLDAO::destroyPDO();
     // this should return the same timezone offset as the config value
     $test_dao = new TestMySQLDAO();
     $tz_server = $test_dao->getTimezoneOffset();
     if ($this->isTimeZoneSupported()) {
         $this->assertEqual('Europe/London', $tz_server['tz_offset']);
     } else {
         $this->assertEqual($tz_config, $tz_server['tz_offset']);
     }
     Config::destroyInstance();
 }