Skip to content

Commit 7ff3038

Browse files
ACQE-8867: Order Management Asynchronous Grid Reindex
- Updated variables used once
1 parent b7eda07 commit 7ff3038

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

dev/tests/integration/testsuite/Magento/Sales/Model/CronJob/GridAsyncInsertCronTest.php

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ protected function setUp(): void
142142
]
143143
public function testOrderAsyncGridInsert(): void
144144
{
145-
$order = $this->fixtures->get('order');
146-
$orderId = (int)$order->getEntityId();
145+
$orderId = (int)$this->fixtures->get('order')->getEntityId();
147146

148147
// Verify order exists in main table but NOT in grid
149148
$this->assertEntityInMainTableButNotInGrid(
@@ -198,8 +197,7 @@ public function testOrderAsyncGridInsert(): void
198197
]
199198
public function testInvoiceAsyncGridInsert(): void
200199
{
201-
$invoice = $this->fixtures->get('invoice');
202-
$invoiceId = (int)$invoice->getEntityId();
200+
$invoiceId = (int)$this->fixtures->get('invoice')->getEntityId();
203201

204202
// Verify invoice exists in main table but NOT in grid
205203
$this->assertEntityInMainTableButNotInGrid(
@@ -254,8 +252,7 @@ public function testInvoiceAsyncGridInsert(): void
254252
]
255253
public function testShipmentAsyncGridInsert(): void
256254
{
257-
$shipment = $this->fixtures->get('shipment');
258-
$shipmentId = (int)$shipment->getEntityId();
255+
$shipmentId = (int)$this->fixtures->get('shipment')->getEntityId();
259256

260257
// Verify shipment exists in main table but NOT in grid
261258
$this->assertEntityInMainTableButNotInGrid(
@@ -311,8 +308,7 @@ public function testShipmentAsyncGridInsert(): void
311308
]
312309
public function testCreditmemoAsyncGridInsert(): void
313310
{
314-
$creditmemo = $this->fixtures->get('creditmemo');
315-
$creditmemoId = (int)$creditmemo->getEntityId();
311+
$creditmemoId = (int)$this->fixtures->get('creditmemo')->getEntityId();
316312

317313
// Verify creditmemo exists in main table but NOT in grid
318314
$this->assertEntityInMainTableButNotInGrid(
@@ -346,9 +342,7 @@ public function testCreditmemoAsyncGridInsert(): void
346342
*/
347343
private function executeAsyncGridInsert(string $virtualTypeName): void
348344
{
349-
/** @var GridAsyncInsert $gridAsyncInsert */
350-
$gridAsyncInsert = $this->objectManager->get($virtualTypeName);
351-
$gridAsyncInsert->asyncInsert();
345+
$this->objectManager->get($virtualTypeName)->asyncInsert();
352346
}
353347

354348
/**
@@ -368,15 +362,13 @@ private function assertEntityInMainTableButNotInGrid(
368362
int $entityId,
369363
string $entityType
370364
): void {
371-
$entityInMainTable = $this->getEntityFromTable($mainTable, $entityId);
372365
$this->assertNotEmpty(
373-
$entityInMainTable,
366+
$this->getEntityFromTable($mainTable, $entityId),
374367
"{$entityType} {$entityId} should exist in {$mainTable} table"
375368
);
376369

377-
$entityInGrid = $this->getEntityFromTable($gridTable, $entityId);
378370
$this->assertEmpty(
379-
$entityInGrid,
371+
$this->getEntityFromTable($gridTable, $entityId),
380372
"{$entityType} {$entityId} should NOT be in {$gridTable} yet (before async insert)"
381373
);
382374
}

0 commit comments

Comments
 (0)