public function RestClientTest::testQuery in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 tests/src/Unit/RestClientTest.php \Drupal\Tests\salesforce\Unit\RestClientTest::testQuery()
- 5.0.x tests/src/Unit/RestClientTest.php \Drupal\Tests\salesforce\Unit\RestClientTest::testQuery()
@covers ::query
File
- tests/
src/ Unit/ RestClientTest.php, line 217
Class
- RestClientTest
- @coversDefaultClass \Drupal\salesforce\Rest\RestClient @group salesforce
Namespace
Drupal\Tests\salesforce\UnitCode
public function testQuery() {
$this
->initClient(array_merge($this->methods, [
'apiCall',
]));
$rawQueryResult = [
'totalSize' => 1,
'done' => TRUE,
'records' => [
0 => [
'attributes' => [
'type' => 'Foo',
'url' => 'Bar',
],
'Id' => $this->salesforce_id,
],
],
];
$this->client
->expects($this
->once())
->method('apiCall')
->willReturn($rawQueryResult);
// @TODO this doesn't seem like a very good test.
$this
->assertEquals(new SelectQueryResult($rawQueryResult), $this->client
->query(new SelectQuery("")));
}