From de6527afd67a79d53bb8a839e35d232a770e9ccf Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 30 May 2020 03:16:54 +0100 Subject: [PATCH] wip --- src/Glassboxx/Config.php | 2 +- src/Glassboxx/ConfigInterface.php | 18 ++++++++++++++++++ src/Glassboxx/Request/AuthTokenRequest.php | 6 +++--- .../Glassboxx/Request/AuthTokenRequestTest.php | 4 ++-- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 src/Glassboxx/ConfigInterface.php diff --git a/src/Glassboxx/Config.php b/src/Glassboxx/Config.php index 1f7a16a..25d6337 100644 --- a/src/Glassboxx/Config.php +++ b/src/Glassboxx/Config.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Opdavies\Glassboxx; -class Config +final class Config implements ConfigInterface { /** @var int $vendorId */ private $vendorId; diff --git a/src/Glassboxx/ConfigInterface.php b/src/Glassboxx/ConfigInterface.php new file mode 100644 index 0000000..e9049c8 --- /dev/null +++ b/src/Glassboxx/ConfigInterface.php @@ -0,0 +1,18 @@ +client = $client; } - public function withConfig(Config $config): self + public function withConfig(ConfigInterface $config): self { $this->config = $config; diff --git a/tests/Glassboxx/Request/AuthTokenRequestTest.php b/tests/Glassboxx/Request/AuthTokenRequestTest.php index b1baefe..e58349f 100644 --- a/tests/Glassboxx/Request/AuthTokenRequestTest.php +++ b/tests/Glassboxx/Request/AuthTokenRequestTest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Opdavies\Glassboxx\Tests\Glassboxx\Request; -use Opdavies\Glassboxx\Config; +use Opdavies\Glassboxx\ConfigInterface; use Opdavies\Glassboxx\Request\AuthTokenRequest; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpClient\MockHttpClient; @@ -14,7 +14,7 @@ class AuthTokenRequestTest extends TestCase { public function testThatItGetsAnAuthCode(): void { - $config = $this->getMockBuilder(Config::class) + $config = $this->getMockBuilder(ConfigInterface::class) ->onlyMethods([]) ->setConstructorArgs( [