3 require_once 'PHPUnit/Framework.php';
9 * @copyright Copyright (c)2002 - 2007, Blue Static
13 class DateTest
extends PHPUnit_Framework_TestCase
17 const DATE_FORMAT
= 'Y-m-d H:i:s';
19 public function setUp()
21 require_once ISSO
. '/App.php';
22 $this->fixture
= BSApp
::LoadModule('Date');
25 public function testGmtTimes()
27 $this->fixture
->setUserTimeZone(0);
29 $this->assertEquals(gmdate(self
::DATE_FORMAT
, TIMENOW
), $this->fixture
->format(self
::DATE_FORMAT
, TIMENOW
));
32 public function testGmtMinus8()
34 $this->fixture
->setUserTimeZone(-8);
35 $this->assertEquals('2007-04-01 00:00:00', $this->fixture
->format(self
::DATE_FORMAT
, 1175414400));
38 public function testGmtNoAdjust()
40 $this->fixture
->setUserTimeZone(4);
41 $this->assertEquals(gmdate(self
::DATE_FORMAT
, TIMENOW
), $this->fixture
->format(self
::DATE_FORMAT
, TIMENOW
, false));
44 public function testTimezoneList()
46 $this->assertEquals(sizeof(BSDate
::FetchTimeZoneList()), 30);