array( 'name' => 'name', 'comment' => 'Name of the Company', 'label' => 'LBL_NAME', 'displayParams' => array ( 'enableConnectors' => '1', 'module' => 'Accounts', 'connectors' => array ( '0' => 'ext_rest_linkedin' ) ), 'customCodeRenderField' => '1', 'customCode' => 'Search', 'tabindex' => '100' ), 'colData' => array ( 'field' => array ( 'name' => 'name', 'comment' => 'Name of the Company', 'label' => 'LBL_NAME', 'displayParams' => array ( 'enableConnectors' => '1', 'module' => 'Accounts', 'connectors' => array ( '0' => 'ext_rest_linkedin' ) ), 'customCodeRenderField' => '1', 'customCode' => 'Search', 'tabindex' => '100' ) ) ); require_once('include/Sugar_Smarty.php'); $ss = new Sugar_Smarty(); include('modules/Connectors/connectors/sources/ext/rest/linkedin/config.php'); $ss->assign('config', $config); $ss->left_delimiter = '{{'; $ss->right_delimiter = '}}'; require_once 'include/Smarty/plugins/function.sugar_evalcolumn.php'; $output = smarty_function_sugar_evalcolumn($params, $ss); //Doing this the hack way...customCode is 65 chars long. //if customCodeRenderField is set then the connectors have already been processed $this->assertEquals(65, strlen($output),'Connectors should not be processed when customCode is set to customCodeRenderField'); //now if customCodeRenderField is not set then process as normal unset($params['var']['customCodeRenderField']); unset($params['colData']['field']['customCodeRenderField']); $output = smarty_function_sugar_evalcolumn($params, $ss); $this->assertGreaterThan(65, strlen($output),'Connectors should not be processed when customCode is set to customCodeRenderField'); } }