diff --git a/src/Client.php b/src/Client.php index c55cd04..1ffb4d2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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) { diff --git a/tests/ClientTest.php b/tests/ClientTest.php index ebaee7a..3079157 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -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 @@ -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 */