Lib_Test_Partner_QueryOptionsTest

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

Defined (1)

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

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