@@ 31-64 (lines=34) @@ | ||
28 | /** |
|
29 | * @test |
|
30 | */ |
|
31 | public function ItGivesAListOfMonetaryAccounts() |
|
32 | { |
|
33 | $this->bunqClient->get('/v1/user/1/monetary-account')->willReturn( |
|
34 | [ |
|
35 | 'Response' => [ |
|
36 | 'MonetaryAccountBank' => [ |
|
37 | [ |
|
38 | 'id' => 1, |
|
39 | ], |
|
40 | [ |
|
41 | 'id' => 2, |
|
42 | ], |
|
43 | ], |
|
44 | ], |
|
45 | ] |
|
46 | ); |
|
47 | ||
48 | $result = $this->resource->listMonetaryAccounts(1); |
|
49 | ||
50 | $expectedResult = [ |
|
51 | 'Response' => [ |
|
52 | 'MonetaryAccountBank' => [ |
|
53 | [ |
|
54 | 'id' => 1, |
|
55 | ], |
|
56 | [ |
|
57 | 'id' => 2, |
|
58 | ], |
|
59 | ], |
|
60 | ], |
|
61 | ]; |
|
62 | ||
63 | $this->assertEquals($expectedResult, $result); |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @test |
@@ 30-63 (lines=34) @@ | ||
27 | /** |
|
28 | * @test |
|
29 | */ |
|
30 | public function itReturnsAListOfPayments() |
|
31 | { |
|
32 | $this->bunqClient->get('/v1/user/1/monetary-account/1/payment')->willReturn( |
|
33 | [ |
|
34 | 'Response' => [ |
|
35 | [ |
|
36 | 'Payment' => [ |
|
37 | 'amount' => [ |
|
38 | 'value' => '12.50', |
|
39 | 'currency' => 'EUR', |
|
40 | ], |
|
41 | ], |
|
42 | ], |
|
43 | ], |
|
44 | ] |
|
45 | ); |
|
46 | ||
47 | $result = $this->resource->listPayments(1, 1); |
|
48 | ||
49 | $expectedResult = [ |
|
50 | 'Response' => [ |
|
51 | [ |
|
52 | 'Payment' => [ |
|
53 | 'amount' => [ |
|
54 | 'value' => 1250, |
|
55 | 'currency' => 'EUR', |
|
56 | ], |
|
57 | ], |
|
58 | ], |
|
59 | ], |
|
60 | ]; |
|
61 | ||
62 | $this->assertEquals($expectedResult, $result); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * @test |