Пример #1
0
 /**
  *	Testing getOffsetFromGMT
  *
  * @param mixed  $tz		Which time zone? (can be string or numeric
  * @param string $setTime  What time should be set?
  * @param bool   $hours	Return offset in hours (true) or seconds?
  * @param string $expected What should the resulting time string look like?
  *
  * @return void
  * @dataProvider casesGetOffsetFromGMT
  */
 public function testGetOffsetFromGMT($tz, $setTime, $hours, $expected)
 {
     if (is_null($tz)) {
         $testJDate = new JDate($setTime);
     } else {
         $testJDate = new JDate($setTime, $tz);
     }
     if (is_null($hours)) {
         $offset = $testJDate->getOffsetFromGMT();
     } else {
         $offset = $testJDate->getOffsetFromGMT($hours);
     }
     $this->assertThat($offset, $this->equalTo($expected));
 }
Пример #2
0
 public function getOffset($hours = false)
 {
     return C_JOOMLA_15 == 1 ? parent::getOffset() : parent::getOffsetFromGMT($hours);
 }