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

Commit 149c261

Browse files
committed
MAGETWO-63640: View Signifyd Guarantee Status in Order Grid
- Order grid sync after case creation
1 parent abf6d51 commit 149c261

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Model/CaseServices/CreationServiceTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,15 @@ public function testCreateForOrder()
175175
/** @var CaseRepositoryInterface $caseRepository */
176176
$caseRepository = $this->objectManager->get(CaseRepositoryInterface::class);
177177
$caseEntity = $caseRepository->getByCaseId(123123);
178+
$gridGuarantyStatus = $this->getOrderGridGuarantyStatus($caseEntity->getOrderId());
178179

179180
static::assertNotEmpty($caseEntity);
180181
static::assertEquals($order->getEntityId(), $caseEntity->getOrderId());
182+
static::assertEquals(
183+
$gridGuarantyStatus,
184+
$caseEntity->getGuaranteeDisposition(),
185+
'Signifyd guaranty status in sales_order_grid table does not match case entity guaranty status'
186+
);
181187
}
182188

183189
/**
@@ -210,4 +216,24 @@ private function getOrder()
210216

211217
return $this->order;
212218
}
219+
220+
/**
221+
* Returns value of signifyd_guarantee_status column from sales order grid
222+
*
223+
* @param int $orderEntityId
224+
* @return string|null
225+
*/
226+
private function getOrderGridGuarantyStatus($orderEntityId)
227+
{
228+
/** @var \Magento\Sales\Model\ResourceModel\Order\Grid\Collection $orderGridCollection */
229+
$orderGridCollection = $this->objectManager->get(
230+
\Magento\Sales\Model\ResourceModel\Order\Grid\Collection::class
231+
);
232+
233+
$items = $orderGridCollection->addFilter($orderGridCollection->getIdFieldName(), $orderEntityId)
234+
->getItems();
235+
$result = array_pop($items);
236+
237+
return isset($result['signifyd_guarantee_status']) ? $result['signifyd_guarantee_status'] : null;
238+
}
213239
}

0 commit comments

Comments
 (0)