Lots of testing going on... almost completed the input test. Working towards full...
[isso.git] / UnitTest / DateTest.php
1 <?php
2
3 /**
4 * DateTest
5 *
6 * @author Blue Static
7 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
8 * @version $Revision$
9 * @package ISSO Tests
10 *
11 */
12 class DateTest extends UnitTestCase
13 {
14 private $fixture;
15
16 const DATE_FORMAT = 'Y-m-d H:i:s';
17
18 public function setUp()
19 {
20 $this->fixture = BSRegister::LoadModule('Date');
21 }
22
23 public function testGmtTimes()
24 {
25 $this->fixture->setUserTimeZone(0);
26
27 $this->assertEqual(gmdate(self::DATE_FORMAT, TIMENOW), $this->fixture->format(self::DATE_FORMAT, TIMENOW));
28 }
29
30 public function testGmtMinus8()
31 {
32 $this->fixture->setUserTimeZone(-8);
33 $this->assertEqual(date(self::DATE_FORMAT, TIMENOW), $this->fixture->format(self::DATE_FORMAT, TIMENOW));
34 }
35
36 public function testGmtNoAdjust()
37 {
38 $this->fixture->setUserTimeZone(4);
39 $this->assertEqual(gmdate(self::DATE_FORMAT, TIMENOW), $this->fixture->format(self::DATE_FORMAT, TIMENOW, false));
40 }
41
42 public function testTimezoneList()
43 {
44 $this->assertEqual(sizeof(BSDate::FetchTimeZoneList()), 30);
45 }
46 }
47
48 ?>