You are here

public function ApigeeEdgeManagementCliServiceTest::testHandleHttpClientExceptions0Code in Apigee Edge 8

Make sure method outputs more info for error codes.

File

tests/src/Unit/Command/Util/ApigeeEdgeManagementCliServiceTest.php, line 400

Class

ApigeeEdgeManagementCliServiceTest
Test ApigeeEdgeManagementCliService.

Namespace

Drupal\Tests\apigee_edge\Unit\Command\Util

Code

public function testHandleHttpClientExceptions0Code() {

  // Error message should output to user.
  $io = $this
    ->prophesize(StyleInterface::class);
  $io
    ->error(Argument::containingString('Error connecting to Apigee Edge'))
    ->shouldBeCalledTimes(1);
  $io
    ->note(Argument::containingString('Your system may not be able to connect'))
    ->shouldBeCalledTimes(1);

  // Create network error.
  $exception = $this
    ->prophesize(TransferException::class);
  $apigee_edge_management_cli_service = new ApigeeEdgeManagementCliService($this->httpClient
    ->reveal());
  $apigee_edge_management_cli_service
    ->handleHttpClientExceptions($exception
    ->reveal(), $io
    ->reveal(), [
    $this,
    'mockDt',
  ], 'http://api.apigee.com/test', $this->org, $this->email);
}