3 require_once 'PHPUnit/Framework.php';
9 * @copyright Copyright (c)2005 - 2008, 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 require_once ISSO
. '/Date.php';
23 $this->fixture
= new BSDate();
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
::fetch_timezone_list()), 30);