-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntrafiExclusionsTest.php
More file actions
89 lines (72 loc) · 2.38 KB
/
IntrafiExclusionsTest.php
File metadata and controls
89 lines (72 loc) · 2.38 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
namespace Tests\Services;
use Increase\Client;
use Increase\IntrafiExclusions\IntrafiExclusion;
use Increase\Page;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
#[CoversNothing]
final class IntrafiExclusionsTest extends TestCase
{
protected Client $client;
protected function setUp(): void
{
parent::setUp();
$testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010';
$client = new Client(apiKey: 'My API Key', baseUrl: $testUrl);
$this->client = $client;
}
#[Test]
public function testCreate(): void
{
$result = $this->client->intrafiExclusions->create(
entityID: 'entity_n8y8tnk2p9339ti393yi',
fdicCertificateNumber: '314159'
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(IntrafiExclusion::class, $result);
}
#[Test]
public function testCreateWithOptionalParams(): void
{
$result = $this->client->intrafiExclusions->create(
entityID: 'entity_n8y8tnk2p9339ti393yi',
fdicCertificateNumber: '314159'
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(IntrafiExclusion::class, $result);
}
#[Test]
public function testRetrieve(): void
{
$result = $this->client->intrafiExclusions->retrieve(
'account_in71c4amph0vgo2qllky'
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(IntrafiExclusion::class, $result);
}
#[Test]
public function testList(): void
{
$page = $this->client->intrafiExclusions->list();
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(Page::class, $page);
if ($item = $page->getItems()[0] ?? null) {
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(IntrafiExclusion::class, $item);
}
}
#[Test]
public function testArchive(): void
{
$result = $this->client->intrafiExclusions->archive(
'intrafi_exclusion_ygfqduuzpau3jqof6jyh'
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(IntrafiExclusion::class, $result);
}
}