/** * @covers \jones\novaposhta\http\ClientFactory::create */ public function testCreateWithVerify() { $this->createApp(['components' => ['novaposhta' => ['class' => 'jones\\novaposhta\\Api', 'verify' => true, 'certPath' => '/etc/ssl/tmp.pem']]]); $client = $this->httpClientFactory->create(); static::assertTrue($client instanceof ClientInterface); }
/** * @inheritdoc */ public function execute() { $client = $this->factory->create(); $response = $client->execute($this, $this->converter->getContentType(), $this->getUrl()); return $this->converter->decode($response); }
/** * Create mock for http client factory */ private function initHttpClientFactoryMock() { $this->httpClient = $this->getMockBuilder(Client::class)->disableOriginalConstructor()->setMethods(['execute'])->getMock(); $this->httpClientFactory = $this->getMockBuilder(ClientFactory::class)->setMethods(['create'])->getMock(); $this->httpClientFactory->expects(static::any())->method('create')->willReturn($this->httpClient); }