public function testset_notification_body() { $opportunity = new Opportunity(); //test with attributes preset and verify template variables are set accordingly $opportunity->name = 'test'; $opportunity->amount = '100'; $opportunity->date_closed = '2015-02-11 17:30:00'; $opportunity->description = 'tes description'; $opportunity->sales_stage = 'Value Proposition'; $result = $opportunity->set_notification_body(new Sugar_Smarty(), $opportunity); $this->assertEquals($opportunity->name, $result->_tpl_vars['OPPORTUNITY_NAME']); $this->assertEquals($opportunity->amount, $result->_tpl_vars['OPPORTUNITY_AMOUNT']); $this->assertEquals($opportunity->date_closed, $result->_tpl_vars['OPPORTUNITY_CLOSEDATE']); $this->assertEquals($opportunity->sales_stage, $result->_tpl_vars['OPPORTUNITY_STAGE']); $this->assertEquals($opportunity->description, $result->_tpl_vars['OPPORTUNITY_DESCRIPTION']); }