public function RestClientTest::testExceptionApiCall in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 tests/src/Unit/RestClientTest.php \Drupal\Tests\salesforce\Unit\RestClientTest::testExceptionApiCall()
- 5.0.x tests/src/Unit/RestClientTest.php \Drupal\Tests\salesforce\Unit\RestClientTest::testExceptionApiCall()
@covers ::apiCall
File
- tests/
src/ Unit/ RestClientTest.php, line 139
Class
- RestClientTest
- @coversDefaultClass \Drupal\salesforce\Rest\RestClient @group salesforce
Namespace
Drupal\Tests\salesforce\UnitCode
public function testExceptionApiCall() {
$this
->initClient();
// Test that SF client throws an exception for non-200 response.
$response = new GuzzleResponse(456);
$this->client
->expects($this
->any())
->method('httpRequest')
->willReturn($response);
$this
->expectException(\Exception::class);
$this->client
->apiCall('');
}