Lib_Test_Enterprise_QueryMoreTest

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

Defined (1)

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

/lib/Force.com-Toolkit-for-PHP/unit_test/Lib/Test/Enterprise/QueryMoreTest.php  
  1. class Lib_Test_Enterprise_QueryMoreTest extends Lib_Test_TestAbstractEnterprise 
  2. public function getTestName() 
  3. return 'QueryMore'; 
  4.  
  5. protected function _run() 
  6.  
  7. $query = 'SELECT NumberOfEmployees from Lead where NumberOfEmployees != null order by NumberOfEmployees'; 
  8. $options = new QueryOptions(200); 
  9. $this->_mySforceConnection->setQueryOptions($options); 
  10. $response = $this->_mySforceConnection->query($query); 
  11.  
  12. !$done = false; 
  13. echo "Size of records: ".$response ->size."\n"; 
  14.  
  15. if ($response->size > 0) { 
  16. while (!$done) { 
  17. foreach ($response->records as $record) { 
  18. echo $record->NumberOfEmployees."\r\n"; 
  19. if ($response->done != true) { 
  20. echo "***** Get Next Chunk *****\n"; 
  21. try { 
  22. $response = $this->_mySforceConnection->queryMore($response->queryLocator); 
  23. } catch (Exception $e) { 
  24. print_r($this->_mySforceConnection->getLastRequest()); 
  25. echo $e->faultstring; 
  26. } else { 
  27. $done = true;