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