-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWireDrawdownRequestsTest.php
More file actions
112 lines (97 loc) · 3.48 KB
/
WireDrawdownRequestsTest.php
File metadata and controls
112 lines (97 loc) · 3.48 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
namespace Tests\Services;
use Increase\Client;
use Increase\Core\Util;
use Increase\Page;
use Increase\WireDrawdownRequests\WireDrawdownRequest;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
#[CoversNothing]
final class WireDrawdownRequestsTest extends TestCase
{
protected Client $client;
protected function setUp(): void
{
parent::setUp();
$testUrl = Util::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->wireDrawdownRequests->create(
accountNumberID: 'account_number_v18nkfqm6afpsrvy82b2',
amount: 10000,
creditorAddress: [
'city' => 'New York', 'country' => 'US', 'line1' => '33 Liberty Street',
],
creditorName: 'National Phonograph Company',
debtorAddress: [
'city' => 'New York', 'country' => 'US', 'line1' => '33 Liberty Street',
],
debtorName: 'Ian Crease',
unstructuredRemittanceInformation: 'Invoice 29582',
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(WireDrawdownRequest::class, $result);
}
#[Test]
public function testCreateWithOptionalParams(): void
{
$result = $this->client->wireDrawdownRequests->create(
accountNumberID: 'account_number_v18nkfqm6afpsrvy82b2',
amount: 10000,
creditorAddress: [
'city' => 'New York',
'country' => 'US',
'line1' => '33 Liberty Street',
'line2' => 'x',
'postalCode' => '10045',
'state' => 'NY',
],
creditorName: 'National Phonograph Company',
debtorAddress: [
'city' => 'New York',
'country' => 'US',
'line1' => '33 Liberty Street',
'line2' => 'x',
'postalCode' => '10045',
'state' => 'NY',
],
debtorName: 'Ian Crease',
unstructuredRemittanceInformation: 'Invoice 29582',
chargeBearer: 'shared',
debtorAccountNumber: '987654321',
debtorExternalAccountID: 'debtor_external_account_id',
debtorRoutingNumber: '101050001',
endToEndIdentification: 'x',
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(WireDrawdownRequest::class, $result);
}
#[Test]
public function testRetrieve(): void
{
$result = $this->client->wireDrawdownRequests->retrieve(
'wire_drawdown_request_q6lmocus3glo0lr2bfv3'
);
// @phpstan-ignore-next-line method.alreadyNarrowedType
$this->assertInstanceOf(WireDrawdownRequest::class, $result);
}
#[Test]
public function testList(): void
{
$page = $this->client->wireDrawdownRequests->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(WireDrawdownRequest::class, $item);
}
}
}