Skip to content

Commit

Permalink
test update
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulritter committed Mar 20, 2024
1 parent 695b754 commit 0b1e444
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Test/Unit/Model/Api/GuestAdyenStateDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Adyen\Payment\Helper\StateData;
use Adyen\Payment\Model\Api\GuestAdyenStateData;
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase;
use Magento\Framework\App\State;
use Magento\Framework\Exception\InputException;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Quote\Model\QuoteIdMask;
Expand Down Expand Up @@ -51,10 +52,16 @@ public function testSaveSuccessful()
$stateData = '{"stateData":"dummyData"}';
$cartId = 'ABC123456789';

$stateDataMock = $this->createMock(\Adyen\Payment\Model\StateData::class);
$stateDataMock->method('getEntityId')->willReturn(1);

$this->quoteIdMaskFactoryMock->method('create')->willReturn($this->quoteIdMaskMock);
$this->stateDataHelperMock->expects($this->once())->method('saveStateData');
$this->stateDataHelperMock->expects($this->once())->method('saveStateData')->willReturn($stateDataMock);
//should return int


$this->guestAdyenStateDataModel->save($stateData, $cartId);
// $this->assertIsInt($result);
}

public function testRemoveSuccessful()
Expand All @@ -64,7 +71,6 @@ public function testRemoveSuccessful()

$this->quoteIdMaskFactoryMock->method('create')->willReturn($this->quoteIdMaskMock);
$this->stateDataHelperMock->expects($this->once())->method('removeStateData');

$this->guestAdyenStateDataModel->remove($stateDataId, $cartId);
}

Expand Down

0 comments on commit 0b1e444

Please sign in to comment.