mirror of
https://github.com/opdavies/glassboxx-sdk-php.git
synced 2025-01-22 12:07:32 +00:00
wip
This commit is contained in:
parent
b042256e45
commit
de6527afd6
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Opdavies\Glassboxx;
|
||||
|
||||
class Config
|
||||
final class Config implements ConfigInterface
|
||||
{
|
||||
/** @var int $vendorId */
|
||||
private $vendorId;
|
||||
|
|
18
src/Glassboxx/ConfigInterface.php
Normal file
18
src/Glassboxx/ConfigInterface.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Opdavies\Glassboxx;
|
||||
|
||||
interface ConfigInterface
|
||||
{
|
||||
public function __construct(
|
||||
int $vendorId,
|
||||
string $username,
|
||||
string $password
|
||||
);
|
||||
|
||||
public function getPassword(): string;
|
||||
|
||||
public function getUsername(): string;
|
||||
|
||||
public function getVendorId(): int;
|
||||
}
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Opdavies\Glassboxx\Request;
|
||||
|
||||
use Opdavies\Glassboxx\Config;
|
||||
use Opdavies\Glassboxx\ConfigInterface;
|
||||
use Symfony\Component\HttpClient\HttpClient;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
|
@ -12,7 +12,7 @@ final class AuthTokenRequest extends AbstractRequest
|
|||
{
|
||||
public const ENDPOINT = '/integration/admin/token';
|
||||
|
||||
/** @var Config */
|
||||
/** @var ConfigInterface */
|
||||
private $config;
|
||||
|
||||
/** @var HttpClient */
|
||||
|
@ -23,7 +23,7 @@ final class AuthTokenRequest extends AbstractRequest
|
|||
$this->client = $client;
|
||||
}
|
||||
|
||||
public function withConfig(Config $config): self
|
||||
public function withConfig(ConfigInterface $config): self
|
||||
{
|
||||
$this->config = $config;
|
||||
|
||||
|
|
|
@ -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(
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue