3 require_once 'PHPUnit/Framework.php';
9 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
14 class DateTest
extends PHPUnit_Framework_TestCase
18 const DATE_FORMAT
= 'Y-m-d H:i:s';
20 public function setUp()
22 require_once 'ISSO/App.php';
23 $this->fixture
= BSApp
::LoadModule('Date');
26 public function testGmtTimes()
28 $this->fixture
->setUserTimeZone(0);
30 $this->assertEquals(gmdate(self
::DATE_FORMAT
, TIMENOW
), $this->fixture
->format(self
::DATE_FORMAT
, TIMENOW
));
33 public function testGmtMinus8()
35 $this->fixture
->setUserTimeZone(-8);
36 $this->assertEquals('2007-04-01 00:00:00', $this->fixture
->format(self
::DATE_FORMAT
, 1175414400));
39 public function testGmtNoAdjust()
41 $this->fixture
->setUserTimeZone(4);
42 $this->assertEquals(gmdate(self
::DATE_FORMAT
, TIMENOW
), $this->fixture
->format(self
::DATE_FORMAT
, TIMENOW
, false
));
45 public function testTimezoneList()
47 $this->assertEquals(sizeof(BSDate
::FetchTimeZoneList()), 30);