This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDepositTest.php
63 lines (58 loc) · 2.05 KB
/
DepositTest.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
54
55
56
57
58
59
60
61
62
63
<?php
namespace KuMEX\SDK\Tests;
use KuMEX\SDK\Exceptions\BusinessException;
use KuMEX\SDK\PrivateApi\Deposit;
class DepositTest extends TestCase
{
protected $apiClass = Deposit::class;
protected $apiWithAuth = true;
/**
* @dataProvider apiProvider
* @param Deposit $api
* @return array|string
* @throws \KuMEX\SDK\Exceptions\BusinessException
* @throws \KuMEX\SDK\Exceptions\HttpException
* @throws \KuMEX\SDK\Exceptions\InvalidApiUriException
*/
public function testGetAddress(Deposit $api)
{
// try {
// $address = $api->getAddress('XBT');
// if ($address !== null) {
// $this->assertInternalType('array', $address);
// $this->assertArrayHasKey('address', $address);
// $this->assertArrayHasKey('memo', $address);
// }
// } catch (BusinessException $e) {
// // deposit.disabled
// if ($e->getResponse()->getApiCode() == '260200') {
// return;
// }
// throw $e;
// }
$this->assertTrue(true);
}
/**
* @dataProvider apiProvider
* @param Deposit $api
* @return array|string
* @throws \KuMEX\SDK\Exceptions\BusinessException
* @throws \KuMEX\SDK\Exceptions\HttpException
* @throws \KuMEX\SDK\Exceptions\InvalidApiUriException
*/
public function testGetDeposits(Deposit $api)
{
$data = $api->getDeposits(['currency' => 'XBT'], ['currentPage' => 1, 'pageSize' => 10]);
$this->assertPagination($data);
foreach ($data['items'] as $item) {
$this->assertArrayHasKey('currency', $item);
$this->assertArrayHasKey('status', $item);
$this->assertArrayHasKey('address', $item);
$this->assertArrayHasKey('isInner', $item);
$this->assertArrayHasKey('amount', $item);
$this->assertArrayHasKey('fee', $item);
$this->assertArrayHasKey('walletTxId', $item);
$this->assertArrayHasKey('createdAt', $item);
}
}
}