-
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.
Browse files
Browse the repository at this point in the history
This reverts commit d936ae8.
- Loading branch information
1 parent
b25e8b6
commit 128bfab
Showing
7 changed files
with
372 additions
and
82 deletions.
There are no files selected for viewing
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
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
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
43 changes: 43 additions & 0 deletions
43
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,43 @@ | ||
<?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']); | ||
} | ||
} |
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
Oops, something went wrong.