Skip to content

Commit 1340ce2

Browse files
committed
MC-36971: Create automated test for "Calculation of invoiced child items in "sales_order_item" table for order with configurable product after partial invoice"
1 parent 6572d43 commit 1340ce2

File tree

1 file changed

+4
-3
lines changed
  • dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice

1 file changed

+4
-3
lines changed

dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,12 @@ public function testPartialInvoiceWitConfigurableProduct(): void
189189
$order = $this->getOrder('100000001');
190190
$post = $this->hydratePost([$order->getItemsCollection()->getFirstItem()->getId() => '1']);
191191
$this->prepareRequest($post, ['order_id' => $order->getEntityId()]);
192-
$this->dispatch('backend/sales/order_invoice/save');
192+
$this->dispatch($this->uri);
193193
$this->assertSessionMessages($this->containsEqual((string)__('The invoice has been created.')));
194194
$orderItems = $this->getOrderItemsQtyInvoiced((int)$order->getEntityId());
195195
$this->assertCount(2, $orderItems);
196-
$this->assertEquals($orderItems[0]['qty_invoiced'], $orderItems[1]['qty_invoiced']);
196+
$this->assertEquals(1, (int)$orderItems[0]);
197+
$this->assertEquals($orderItems[0], $orderItems[1]);
197198
}
198199

199200
/**
@@ -209,7 +210,7 @@ private function getOrderItemsQtyInvoiced(int $orderId): array
209210
->from($this->orderItemResource->getMainTable(), OrderItemInterface::QTY_INVOICED)
210211
->where(OrderItemInterface::ORDER_ID . ' = ?', $orderId);
211212

212-
return $connection->fetchAll($select);
213+
return $connection->fetchCol($select);
213214
}
214215

215216
/**

0 commit comments

Comments
 (0)