Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkittisak committed Jul 1, 2024
1 parent fa3e7a1 commit 88eac04
Showing 1 changed file with 45 additions and 0 deletions.
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']);
}

Check warning on line 43 in Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php

View workflow job for this annotation

GitHub Actions / M2 Coding Standard

Code must not contain multiple empty lines in a row; found 2 empty lines.

}

Check warning on line 45 in Test/Unit/Gateway/Request/APMBuilders/InstallmentAPMBuilderTest.php

View workflow job for this annotation

GitHub Actions / M2 Coding Standard

The closing brace for the class must go on the next line after the body

0 comments on commit 88eac04

Please sign in to comment.