This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,15 @@ public function testCreateForOrder()
175
175
/** @var CaseRepositoryInterface $caseRepository */
176
176
$ caseRepository = $ this ->objectManager ->get (CaseRepositoryInterface::class);
177
177
$ caseEntity = $ caseRepository ->getByCaseId (123123 );
178
+ $ gridGuarantyStatus = $ this ->getOrderGridGuarantyStatus ($ caseEntity ->getOrderId ());
178
179
179
180
static ::assertNotEmpty ($ caseEntity );
180
181
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
+ );
181
187
}
182
188
183
189
/**
@@ -210,4 +216,24 @@ private function getOrder()
210
216
211
217
return $ this ->order ;
212
218
}
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
+ }
213
239
}
You can’t perform that action at this time.
0 commit comments