Skip to content

Commit

Permalink
fix: add getConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Jan 3, 2022
1 parent a0892de commit 3ba8fcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public function __construct(ConfigInterface $config, ClientInterface $httpClient
$this->httpClient = $httpClient;
}

public function getConfig(): ConfigInterface
{
return $this->config;
}

public function fetchAccountInformationForTransaction(TransactionInterface $transaction): AccountInformationResponse
{
if ($transaction instanceof SourceModelInterface) {
Expand Down
10 changes: 4 additions & 6 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
namespace BrokeYourBike\UnitedBank\Tests;

use PHPUnit\Framework\TestCase;
use BrokeYourBike\UnitedBank\Interfaces\ConfigInterface;
use BrokeYourBike\UnitedBank\Client;
use BrokeYourBike\ResolveUri\ResolveUriTrait;
use BrokeYourBike\HttpClient\HttpClientTrait;
use BrokeYourBike\HttpClient\HttpClientInterface;
use BrokeYourBike\HasSourceModel\HasSourceModelTrait;
use BrokeYourBike\UnitedBank\Interfaces\ConfigInterface;
use BrokeYourBike\UnitedBank\Client;

/**
* @author Ivan Stasiuk <brokeyourbike@gmail.com>
Expand All @@ -30,12 +30,10 @@ public function it_implemets_http_client_interface(): void
/** @var \GuzzleHttp\ClientInterface */
$mockedHttpClient = $this->getMockBuilder(\GuzzleHttp\ClientInterface::class)->getMock();

/** @var \Psr\SimpleCache\CacheInterface */
$mockedCache = $this->getMockBuilder(\Psr\SimpleCache\CacheInterface::class)->getMock();

$api = new Client($mockedConfig, $mockedHttpClient, $mockedCache);
$api = new Client($mockedConfig, $mockedHttpClient);

$this->assertInstanceOf(HttpClientInterface::class, $api);
$this->assertSame($mockedConfig, $api->getConfig());
}

/** @test */
Expand Down

0 comments on commit 3ba8fcc

Please sign in to comment.