public function RestClientTest::testExceptionApiCall in Salesforce Suite 8.3
Same name and namespace in other branches
- 8.4 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 @expectedException Exception
File
- tests/
src/ Unit/ RestClientTest.php, line 132  
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->client
    ->apiCall('');
}