Lib_Test_Enterprise_GetDeletedTest

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

Defined (1)

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

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Enterprise/GetDeletedTest.php  
  1. class Lib_Test_Enterprise_GetDeletedTest extends Lib_Test_TestAbstractEnterprise 
  2. public function getTestName() 
  3. return 'GetDeleted'; 
  4.  
  5. protected function _run() 
  6. $sObject = new stdclass(); 
  7. $sObject->FirstName = 'Smith'; 
  8. $sObject->LastName = 'John'; 
  9. $sObject->Phone = '510-555-5555'; 
  10. $sObject->BirthDate = '1927-01-25'; 
  11.  
  12. echo "**** Creating the following:\n"; 
  13. $createResponse = $this->_mySforceConnection->create(array($sObject), 'Contact'); 
  14. print_r($createResponse); 
  15.  
  16. $id = $createResponse->id; 
  17. $deleteResponse = $this->_mySforceConnection->delete(array ($id)); 
  18. echo "***** Deleting record *****\n"; 
  19. print_r($deleteResponse); 
  20.  
  21. echo "***** Wait 60 seconds *****\n"; 
  22. sleep(60); 
  23.  
  24. $currentTime = mktime(); 
  25. // assume that delete occured within the last 5 mins. 
  26. $startTime = $currentTime - (60*10); 
  27. $endTime = $currentTime; 
  28.  
  29. echo "***** Get Deleted Leads *****\n"; 
  30. $getDeletedResponse = $this->_mySforceConnection->getDeleted('Contact', $startTime, $endTime); 
  31. print_r($getDeletedResponse);