/**
  * @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);
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function execute()
 {
     $client = $this->factory->create();
     $response = $client->execute($this, $this->converter->getContentType(), $this->getUrl());
     return $this->converter->decode($response);
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }