Lib_Test_Partner_ProcessSubmitRequestTest

The Gravity Forms Salesforce Add-On Lib Test Partner ProcessSubmitRequestTest class.

Defined (1)

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

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Partner/ProcessSubmitRequestTest.php  
  1. class Lib_Test_Partner_ProcessSubmitRequestTest extends Lib_Test_TestAbstractPartner 
  2. public function getTestName() 
  3. return 'ProcessSubmitRequest'; 
  4.  
  5. /** 
  6. * TODO Implement 
  7. */ 
  8. protected function _run() 
  9. // Create Contact 
  10. $fields = array ( 
  11. 'FirstName' => 'John',  
  12. 'LastName' => 'Smith',  
  13. 'Phone' => '510-555-5555',  
  14. 'BirthDate' => '1950-01-01' 
  15. ); 
  16.  
  17. $sObject = new SObject(); 
  18. $sObject->fields = $fields; 
  19. $sObject->type = 'Contact'; 
  20.  
  21. $sObject2 = new SObject(); 
  22. $sObject2->fields = $fields; 
  23. $sObject2->type = 'Contact'; 
  24.  
  25. $createResponse = $this->_mySforceConnection->create(array($sObject, $sObject2)); 
  26.  
  27. echo "**** Creating the following:\r\n"; 
  28. print_r($createResponse); 
  29.  
  30. $userInfoResponse = $this->_mySforceConnection->getUserInfo(); 
  31. echo "***** Get User Info*****\n"; 
  32. print_r($userInfoResponse); 
  33.  
  34. $processSubmitRequest1 = new ProcessSubmitRequest(); 
  35. $processSubmitRequest1->objectId = $createResponse['0']->id; 
  36. $processSubmitRequest1->comments = "Please approve this request."; 
  37. $processSubmitRequest1->nextApproverIds = array($userInfoResponse->userId); 
  38.  
  39. $processSubmitRequest2 = new ProcessSubmitRequest(); 
  40. $processSubmitRequest2->objectId = $createResponse['1']->id; 
  41. $processSubmitRequest2->comments = "Please approve this request."; 
  42. $processSubmitRequest2->nextApproverIds = array($userInfoResponse->userId); 
  43.  
  44. $processSubmitRequestResponse = $this->_mySforceConnection->processSubmitRequest( 
  45. array($processSubmitRequest1, $processSubmitRequest2) 
  46. ); 
  47. print_r($processSubmitRequestResponse);