Lib_Test_Enterprise_GetUpdatedTest

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

Defined (1)

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

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Enterprise/GetUpdatedTest.php  
  1. class Lib_Test_Enterprise_GetUpdatedTest extends Lib_Test_TestAbstractEnterprise 
  2. public function getTestName() 
  3. return 'GetUpdated'; 
  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. echo "***** Updating record *****\n"; 
  18. $sObject->Id = $id; 
  19. $sObject->Phone = '999-999-9999'; 
  20. $updateResponse = $this->_mySforceConnection->update(array ($sObject), "Contact"); 
  21. print_r($updateResponse); 
  22.  
  23. echo "***** Wait 60 seconds *****\n"; 
  24. sleep(60); 
  25.  
  26. $currentTime = mktime(); 
  27. // assume that update occured within the last 5 mins. 
  28. $startTime = $currentTime-(60*10); 
  29. $endTime = $currentTime; 
  30.  
  31. echo "***** Get Updated Leads *****\n"; 
  32. $getUpdateddResponse = $this->_mySforceConnection->getUpdated('Contact', $startTime, $endTime); 
  33. print_r($getUpdateddResponse);