Lib_Test_Partner_QueryMoreTest

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

Defined (1)

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

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