Lib_Test_Enterprise_ConvertLeadTest

The Gravity Forms Salesforce Add-On Lib Test Enterprise ConvertLeadTest class.

Defined (1)

The class is defined in the following location(s).

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Enterprise/ConvertLeadTest.php  
  1. class Lib_Test_Enterprise_ConvertLeadTest extends Lib_Test_TestAbstractEnterprise 
  2. public function getTestName() 
  3. return 'ConvertLead'; 
  4.  
  5. protected function _run() 
  6. // TODO Need to login on account then create the lead 
  7. // Assign that id here and check the sample 
  8. $newLead = new stdClass(); 
  9. $newLead->Company = 'test enterprise company'; 
  10. $newLead->FirstName = 'John'; 
  11. $newLead->LastName = 'Smith'; 
  12.  
  13. $createResponse = 
  14. $this->_mySforceConnection->create( 
  15. array($newLead), 'Lead' 
  16. ); 
  17.  
  18. echo "**** Created lead:\r\n"; 
  19. print_r($createResponse); 
  20.  
  21. $leadConvert = new stdClass; 
  22. $leadConvert->convertedStatus = 'Closed - Converted'; 
  23. $leadConvert->doNotCreateOpportunity = 'false'; 
  24. $leadConvert->leadId = $createResponse->id; 
  25. $leadConvert->overwriteLeadSource = 'true'; 
  26. $leadConvert->sendNotificationEmail = 'true'; 
  27.  
  28. $leadConvertArray = array($leadConvert); 
  29. $leadConvertResponse = $this->_mySforceConnection->convertLead($leadConvertArray); 
  30.  
  31. print_r($leadConvertResponse);