From 88eac04154f7761bbe5bd0dc22543b939f6c704f Mon Sep 17 00:00:00 2001 From: pynkittisak Date: Mon, 1 Jul 2024 10:27:43 +0700 Subject: [PATCH] Update test --- .../APMBuilders/InstallmentAPMBuilderTest.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php 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']); + } + + +}