-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ClientTest.php
53 lines (42 loc) · 1.58 KB
/
ClientTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
// Copyright (C) 2022 Ivan Stasiuk <[email protected]>.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
namespace BrokeYourBike\GlobusBank\Tests;
use PHPUnit\Framework\TestCase;
use BrokeYourBike\ResolveUri\ResolveUriTrait;
use BrokeYourBike\HttpClient\HttpClientTrait;
use BrokeYourBike\HttpClient\HttpClientInterface;
use BrokeYourBike\GlobusBank\Interfaces\ConfigInterface;
use BrokeYourBike\GlobusBank\Client;
/**
* @author Ivan Stasiuk <[email protected]>
*/
class ClientTest extends TestCase
{
/** @test */
public function it_implemets_http_client_interface(): void
{
/** @var ConfigInterface */
$mockedConfig = $this->getMockBuilder(ConfigInterface::class)->getMock();
/** @var \GuzzleHttp\ClientInterface */
$mockedHttpClient = $this->getMockBuilder(\GuzzleHttp\ClientInterface::class)->getMock();
$api = new Client($mockedConfig, $mockedHttpClient);
$this->assertInstanceOf(HttpClientInterface::class, $api);
$this->assertSame($mockedConfig, $api->getConfig());
}
/** @test */
public function it_uses_http_client_trait(): void
{
$usedTraits = class_uses(Client::class);
$this->assertArrayHasKey(HttpClientTrait::class, $usedTraits);
}
/** @test */
public function it_uses_resolve_uri_trait(): void
{
$usedTraits = class_uses(Client::class);
$this->assertArrayHasKey(ResolveUriTrait::class, $usedTraits);
}
}