-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa3e7a1
commit 88eac04
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Omise\Payment\Test\Unit\Gateway\Request\APMBuilders; | ||
|
||
use Magento\Payment\Gateway\Data\PaymentDataObject; | ||
use Omise\Payment\Gateway\Request\APMBuilder; | ||
use Omise\Payment\Helper\OmiseMoney; | ||
use Omise\Payment\Model\Config\Installment; | ||
use Omise\Payment\Test\Unit\Gateway\Request\APMBuilders\APMBuilderTest; | ||
|
||
class InstallmentAPMBuilderTest extends APMBuilderTest | ||
{ | ||
/** | ||
* @covers Omise\Payment\Gateway\Request\APMBuilder | ||
*/ | ||
public function testApmBuilderForInstallment() | ||
{ | ||
$this->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']); | ||
} | ||
|
||
|
||
} | ||