Skip to content

Commit

Permalink
Fixed test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashish committed Nov 24, 2023
1 parent 7be4995 commit 8648c22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Test/Unit/PaymentDataBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Magento\Store\Api\Data\StoreInterface;
use Omise\Payment\Model\Config\Installment;
use Omise\Payment\Model\Config\Promptpay;
use Omise\Payment\Model\Capabilities;

class PaymentDataBuilderTest extends TestCase
{
Expand All @@ -30,6 +31,7 @@ class PaymentDataBuilderTest extends TestCase
private $configMock;
private $storeManagerMock;
private $storeMock;
private $capabilities;

protected function setUp(): void
{
Expand All @@ -42,6 +44,7 @@ protected function setUp(): void
$this->orderMock = m::mock(OrderInterface::class);
$this->storeManagerMock = m::mock(StoreManagerInterface::class);
$this->storeMock = m::mock(StoreInterface::class);
$this->capabilities = m::mock(Capabilities::class);
}

/**
Expand Down Expand Up @@ -97,7 +100,11 @@ public function testBuild($paymentMethod, $expectedMetadata)
$this->paymentDataMock->shouldReceive('getOrder')->andReturn($this->orderMock);
$this->paymentDataMock->shouldReceive('getPayment')->andReturn($this->paymentMock);

$model = new PaymentDataBuilder($this->ccConfigMock, $this->omiseMoneyMock);
$model = new PaymentDataBuilder(
$this->ccConfigMock,
$this->omiseMoneyMock,
$this->capabilities
);
$result = $model->build(['payment' => $this->paymentDataMock]);

$this->assertEquals(100000, $result['amount']);
Expand Down

0 comments on commit 8648c22

Please sign in to comment.