Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 9750ba1

Browse files
author
Dmytro Yushkin
committed
MAGETWO-63851: Re-implement cancel guarantee mechanism
- Code review fixes
1 parent 5fb868d commit 9750ba1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Model/Guarantee/CancelingServiceTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,31 @@ protected function setUp()
6565
]);
6666
}
6767

68+
/**
69+
* Checks a test case, when Signifyd guarantee was canceled.
70+
*
71+
* @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder
72+
* @magentoDataFixture Magento/Signifyd/_files/case.php
73+
* @magentoConfigFixture current_store fraud_protection/signifyd/active 1
74+
*/
75+
public function testCancelForOrderWithCanceledGuarantee()
76+
{
77+
/** @var CaseRepositoryInterface $caseRepository */
78+
$caseRepository = $this->objectManager->get(CaseRepositoryInterface::class);
79+
$caseEntity = $caseRepository->getByCaseId(self::$caseId);
80+
$caseEntity->setGuaranteeDisposition(CaseInterface::GUARANTEE_CANCELED);
81+
$caseRepository->save($caseEntity);
82+
83+
$this->gateway->expects(self::never())
84+
->method('cancelGuarantee');
85+
86+
$this->logger->expects(self::never())
87+
->method('error');
88+
89+
$result = $this->service->cancelForOrder($caseEntity->getOrderId());
90+
self::assertFalse($result);
91+
}
92+
6893
/**
6994
* Checks a test case, when Signifyd gateway throws an exception.
7095
*

0 commit comments

Comments
 (0)