You are here

public function MockApi::__construct in Auth0 Single Sign On 8.2

MockApi constructor.

Parameters

array $responses Array of GuzzleHttp\Psr7\Response objects.:

array $config Additional optional configuration needed for mocked class.:

File

vendor/auth0/auth0-php/tests/MockApi.php, line 47

Class

MockApi
Class MockApi

Namespace

Auth0\Tests

Code

public function __construct(array $responses = [], array $config = []) {
  $guzzleOptions = [];
  if (count($responses)) {
    $mock = new MockHandler($responses);
    $handler = HandlerStack::create($mock);
    $handler
      ->push(Middleware::history($this->requestHistory));
    $guzzleOptions['handler'] = $handler;
  }
  $this
    ->setClient($guzzleOptions, $config);
}