Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function testSend() |
||
13 | { |
||
14 | $apiClient = $this->getMockBuilder(ApiClient::class) |
||
15 | ->disableOriginalConstructor() |
||
16 | ->getMock(); |
||
17 | |||
18 | $apiClient->expects(self::once())->method('get') |
||
19 | ->with('payment/process/{merchantId}/{payId}/{dttm}/{signature}', [ |
||
20 | 'merchantId' => '012345', |
||
21 | 'payId' => '123456789', |
||
22 | ]) |
||
23 | ->willReturn( |
||
24 | new Response(new ResponseCode(ResponseCode::S200_OK), [], [ |
||
25 | 'Location' => 'https://platebnibrana.csob.cz/pay/vasobchod.cz/6544-4564-sd65111-GF544DS/', |
||
26 | ]) |
||
27 | ); |
||
28 | |||
29 | /** @var ApiClient $apiClient */ |
||
30 | $processPaymentRequest = new ProcessPaymentRequest( |
||
31 | '012345', |
||
32 | '123456789' |
||
33 | ); |
||
34 | |||
35 | $processPaymentResponse = $processPaymentRequest->send($apiClient); |
||
36 | |||
37 | $this->assertInstanceOf(ProcessPaymentResponse::class, $processPaymentResponse); |
||
38 | $this->assertSame('https://platebnibrana.csob.cz/pay/vasobchod.cz/6544-4564-sd65111-GF544DS/', $processPaymentResponse->getGatewayLocationUrl()); |
||
39 | } |
||
40 | |||
42 |