]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/Tasks/TasksTest.php
Added unit tests.
[Github/sugarcrm.git] / tests / modules / Tasks / TasksTest.php
1 <?php
2 require_once "modules/Tasks/Task.php";
3
4 class TasksTest extends Sugar_PHPUnit_Framework_TestCase
5 {
6     public function setUp()
7     {
8         $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
9         }
10
11     public function tearDown()
12     {
13         SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
14         unset($GLOBALS['current_user']);
15     }
16     
17     /**
18      * @group bug39259
19      */
20     public function testListviewTimeDueFieldProperlyHandlesDst()
21     {
22         $task = new Task();
23         $task->name = "New Task";
24         $task->date_due = $GLOBALS['timedate']->to_display_date_time("2010-08-30 15:00:00");
25         $listViewFields = $task->get_list_view_data();
26         
27         $this->assertEquals($listViewFields['TIME_DUE'], $GLOBALS['timedate']->to_display_time("15:00:00"));
28     }
29 }