Lib_Test_Partner_GetDeletedTest

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

Defined (1)

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

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Partner/GetDeletedTest.php  
  1. class Lib_Test_Partner_GetDeletedTest extends Lib_Test_TestAbstractPartner 
  2. public function getTestName() 
  3. return 'GetDeleted'; 
  4.  
  5. protected function _run() 
  6. $obj1->type = 'Lead'; 
  7.  
  8. $fields = array ( 
  9. 'Company' => 'XYZ Company',  
  10. 'FirstName' => 'John',  
  11. 'LastName' => 'Smith',  
  12. 'LeadSource' => 'Other',  
  13. 'NumberOfEmployees' => 1,  
  14. 'Status' => 'Open' 
  15. ); 
  16. $obj1->fields = $fields; 
  17. $createResponse = $this->_mySforceConnection->create(array ($obj1)); 
  18.  
  19. echo "***** Creating Lead *****\n"; 
  20. print_r($createResponse); 
  21.  
  22. $id = $createResponse->id; 
  23. $deleteResponse = $this->_mySforceConnection->delete(array ($id)); 
  24. echo "***** Deleting Lead *****\n"; 
  25. print_r($deleteResponse); 
  26.  
  27. echo "***** Wait 60 seconds *****\n"; 
  28. sleep(60); 
  29.  
  30. $currentTime = mktime(); 
  31. // assume that delete occured within the last 5 mins. 
  32. $startTime = $currentTime - (60*10); 
  33. $endTime = $currentTime; 
  34.  
  35. echo "***** Get Deleted Leads *****\n"; 
  36. $getDeletedResponse = $this->_mySforceConnection->getDeleted('Lead', $startTime, $endTime); 
  37. print_r($getDeletedResponse);