Esempio n. 1
0
 public function testset_notification_body()
 {
     $call = new Call();
     //test with attributes preset and verify template variables are set accordingly
     $call->name = 'test';
     $call->duration_hours = '1';
     $call->duration_minutes = '10';
     $call->status = 'Planned';
     $call->description = 'some text';
     $call->date_start = '2015-09-01 00:02:03';
     $call->current_notify_user = new User(1);
     $call->current_notify_user->new_assigned_user_name = 'Admin';
     $result = $call->set_notification_body(new Sugar_Smarty(), $call);
     $this->assertEquals($call->name, $result->_tpl_vars['CALL_SUBJECT']);
     $this->assertEquals($call->current_notify_user->new_assigned_user_name, $result->_tpl_vars['CALL_TO']);
     $this->assertEquals($call->duration_hours, $result->_tpl_vars['CALL_HOURS']);
     $this->assertEquals($call->duration_minutes, $result->_tpl_vars['CALL_MINUTES']);
     $this->assertEquals($call->status, $result->_tpl_vars['CALL_STATUS']);
     $this->assertEquals('09/01/2015 00:02 UTC(+00:00)', $result->_tpl_vars['CALL_STARTDATE']);
     $this->assertEquals($call->description, $result->_tpl_vars['CALL_DESCRIPTION']);
 }