Example #1
0
 public function tearDown()
 {
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestMeetingUtilities::removeMeetingUsers();
     SugarTestMeetingUtilities::removeAllCreatedMeetings();
     SugarTestTaskUtilities::removeAllCreatedTasks();
     SugarTestProjectUtilities::removeAllCreatedProjects();
     SugarTestProjectTaskUtilities::removeAllCreatedProjectTasks();
     unset($this->timedate);
     unset($this->project);
     unset($GLOBALS['current_user']);
 }
Example #2
0
 public function tearDown()
 {
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     unset($GLOBALS['current_user']);
     if (file_exists($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php.bak')) {
         copy($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php.bak', $GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php');
         unlink($GLOBALS['sugar_config']['cache_dir'] . 'modules/unified_search_modules.php.bak');
     }
     if (file_exists('custom/modules/unified_search_modules_display.php.bak')) {
         copy('custom/modules/unified_search_modules_display.php.bak', 'custom/modules/unified_search_modules_display.php');
         unlink('custom/modules/unified_search_modules_display.php.bak');
     }
     SugarTestTaskUtilities::removeAllCreatedTasks();
     SugarTestAccountUtilities::removeAllCreatedAccounts();
 }
Example #3
0
 /**
  * @group 58702
  * Test if Meetings/Calls/Tasks are shown properly when
  * show completed flag is set
  *
  * @dataProvider dataProvider
  */
 public function testShowCompleted($showCompleted)
 {
     // Create Held Meeting
     $meeting = SugarTestMeetingUtilities::createMeeting();
     $meeting->date_start = $GLOBALS['timedate']->nowDb();
     $meeting->date_end = $GLOBALS['timedate']->nowDb();
     $meeting->status = 'Held';
     $meeting->save();
     $meeting->set_accept_status($GLOBALS['current_user'], 'accept');
     // Create Held Call
     $call = SugarTestCallUtilities::createCall();
     $call->date_start = $GLOBALS['timedate']->nowDb();
     $call->date_end = $GLOBALS['timedate']->nowDb();
     $call->status = 'Held';
     $call->save();
     $call->set_accept_status($GLOBALS['current_user'], 'accept');
     // Create Completed Task
     $task = SugarTestTaskUtilities::createTask();
     $task->date_due = $GLOBALS['timedate']->nowDb();
     $task->status = 'Completed';
     $task->assigned_user_id = $GLOBALS['current_user']->id;
     $task->save();
     // Set query dates
     $start_date_time = $GLOBALS['timedate']->fromString(date("Y-m-d"));
     $end_date_time = $start_date_time->get("+7 days");
     $start_date_time = $start_date_time->get("-7 days");
     // Get all activities for the user
     $result = CalendarActivity::get_activities($GLOBALS['current_user']->id, true, $start_date_time, $end_date_time, 'month', true, $showCompleted);
     // Depending on show completed, get_activities should return 3 entries, the ones we created above
     if ($showCompleted) {
         $this->assertEquals(3, sizeof($result), 'get_activities did not return the Metting, Call and Task as it should have');
         $this->assertEquals($result[0]->sugar_bean->id, $meeting->id, 'Meeting not returned properly');
         $this->assertEquals($result[1]->sugar_bean->id, $call->id, 'Call not returned properly');
         $this->assertEquals($result[2]->sugar_bean->id, $task->id, 'Task not returned properly');
     } else {
         $this->assertEquals(0, sizeof($result), 'get_activities should be empty');
     }
 }
 public function tearDown()
 {
     global $current_user;
     $GLOBALS['db']->query("DELETE FROM meetings_users WHERE user_id = '{$current_user->id}'");
     $GLOBALS['db']->query("DELETE FROM calls_users WHERE user_id = '{$current_user->id}'");
     $GLOBALS['db']->query("DELETE FROM contacts_users WHERE user_id = '{$current_user->id}'");
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     SugarTestMeetingUtilities::removeAllCreatedMeetings();
     SugarTestCallUtilities::removeAllCreatedCalls();
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestTaskUtilities::removeAllCreatedTasks();
     unset($GLOBALS['current_user']);
     unset($GLOBALS['beanFiles']);
     unset($GLOBALS['beanList']);
 }
Example #5
0
 public function tearDown()
 {
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestTaskUtilities::removeAllCreatedTasks();
     unset($GLOBALS['current_user']);
 }
 public function tearDown()
 {
     SugarTestContactUtilities::removeAllCreatedContacts();
     SugarTestTaskUtilities::removeAllCreatedTasks();
     SugarTestHelper::tearDown();
 }