diff --git a/Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php b/Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php new file mode 100644 index 00000000..635e9c91 --- /dev/null +++ b/Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php @@ -0,0 +1,45 @@ +infoMock->method('getMethod')->willReturn(Installment::CODE); + $this->returnUrlHelper->method('create')->willReturn([ + 'url' => 'https://omise.co/complete', + 'card' => 'mock_card', + 'source' => 'mock_source', + 'token' => 'mock_token' + ]); + $this->infoMock->method('getAdditionalInformation')->willReturn('mock_source'); + + $this->builder = new APMBuilder( + $this->returnUrlHelper, + $this->config, + $this->capabilities, + new OmiseMoney(), + $this->requestHelper + ); + + $result = $this->builder->build(['payment' => new PaymentDataObject( + $this->orderMock, + $this->infoMock + )]); + + $this->assertEquals('mock_source', $result['source']); + $this->assertEquals('https://omise.co/complete', $result['return_uri']); + } + + +}