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

Commit b95c369

Browse files
committed
MAGETWO-65103: Setup HOLD status by default after placing order in case Signifyd was used
1 parent d2a0312 commit b95c369

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Model/CaseServices/CreationServiceTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
use Magento\Framework\Api\SearchCriteriaBuilder;
1010
use Magento\Framework\App\ObjectManager;
1111
use Magento\Sales\Api\Data\OrderInterface;
12+
use Magento\Sales\Api\Data\OrderStatusHistoryInterface;
1213
use Magento\Sales\Api\OrderRepositoryInterface;
14+
use Magento\Sales\Model\Order;
1315
use Magento\Signifyd\Api\CaseRepositoryInterface;
1416
use Magento\Signifyd\Model\SignifydGateway\ApiCallException;
1517
use Magento\Signifyd\Model\SignifydGateway\ApiClient;
@@ -184,6 +186,19 @@ public function testCreateForOrder()
184186
$caseEntity->getGuaranteeDisposition(),
185187
'Signifyd guaranty status in sales_order_grid table does not match case entity guaranty status'
186188
);
189+
190+
/** @var OrderRepositoryInterface $orderRepository */
191+
$orderRepository = $this->objectManager->get(OrderRepositoryInterface::class);
192+
$order = $orderRepository->get($caseEntity->getOrderId());
193+
static::assertEquals(Order::STATE_HOLDED, $order->getState());
194+
195+
$histories = $order->getStatusHistories();
196+
static::assertNotEmpty($histories);
197+
198+
/** @var OrderStatusHistoryInterface $orderHoldComment */
199+
$orderHoldComment = array_pop($histories);
200+
static::assertInstanceOf(OrderStatusHistoryInterface::class, $orderHoldComment);
201+
static::assertEquals("Awaiting the Signifyd guarantee disposition.", $orderHoldComment->getComment());
187202
}
188203

189204
/**

Model/CaseServices/UpdatingServiceTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\Signifyd\Model\CaseServices;
77

88
use Magento\Framework\App\ObjectManager;
9-
use Magento\Framework\App\ResourceConnection;
109
use Magento\Sales\Api\Data\OrderStatusHistoryInterface;
1110
use Magento\Sales\Api\OrderRepositoryInterface;
1211
use Magento\Sales\Model\Order;

0 commit comments

Comments
 (0)