]> src.bluestatic.org Git - isso.git/blob - UnitTest/DateTest.php
Cleaing up error reporting and error triggering in Api.php
[isso.git] / UnitTest / DateTest.php
1 <?php
2
3 require_once 'PHPUnit/Framework.php';
4
5 /**
6 * DateTest
7 *
8 * @author Blue Static
9 * @copyright Copyright (c)2002 - 2007, Blue Static
10 * @package ISSO Tests
11 *
12 */
13 class DateTest extends PHPUnit_Framework_TestCase
14 {
15 private $fixture;
16
17 const DATE_FORMAT = 'Y-m-d H:i:s';
18
19 public function setUp()
20 {
21 require_once 'ISSO/App.php';
22 $this->fixture = BSApp::LoadModule('Date');
23 }
24
25 public function testGmtTimes()
26 {
27 $this->fixture->setUserTimeZone(0);
28
29 $this->assertEquals(gmdate(self::DATE_FORMAT, TIMENOW), $this->fixture->format(self::DATE_FORMAT, TIMENOW));
30 }
31
32 public function testGmtMinus8()
33 {
34 $this->fixture->setUserTimeZone(-8);
35 $this->assertEquals('2007-04-01 00:00:00', $this->fixture->format(self::DATE_FORMAT, 1175414400));
36 }
37
38 public function testGmtNoAdjust()
39 {
40 $this->fixture->setUserTimeZone(4);
41 $this->assertEquals(gmdate(self::DATE_FORMAT, TIMENOW), $this->fixture->format(self::DATE_FORMAT, TIMENOW, false));
42 }
43
44 public function testTimezoneList()
45 {
46 $this->assertEquals(sizeof(BSDate::FetchTimeZoneList()), 30);
47 }
48 }
49
50 ?>