public function __construct(Config $config) { $this->apiKey = $config->getApiKey(); $this->baseUrl = $config->getBaseUrl(); $this->acceptLanguage = $config->getAcceptLanguage(); $this->httpHandler = $config->getHttpHandler(); $this->trackingIdHandler = new TrackingIdHandler($config->getTrackingIdCallback(), $config->getStoreTrackingIdCallback()); }
public function test_override_http_handler() { $httpHandler = $this->prophesize(HttpHandler::class)->reveal(); $configArray = $this->getValidConfigArray(); $configArray[Config::HTTP_HANDLER] = $httpHandler; $config = new Config($configArray); $this->assertSame($httpHandler, $config->getHttpHandler()); }