Skip to content

Commit 10f4e1f

Browse files
committed
AC-14049: Missing Billing Address Error in Admin Dashboard When Creating Order via REST API with Only Payment Information
1 parent 82a0445 commit 10f4e1f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/Sales/Test/Unit/Plugin/Model/OrderRepositoryPluginTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Sales\Api\Data\OrderAddressInterface;
12-
use Magento\Sales\Api\Data\OrderInterface;
1312
use Magento\Sales\Api\Data\OrderItemInterface;
13+
use Magento\Sales\Model\Order;
1414
use Magento\Sales\Model\OrderRepository;
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
@@ -32,7 +32,7 @@ class OrderRepositoryPluginTest extends TestCase
3232
private $orderRepository;
3333

3434
/**
35-
* @var OrderInterface|MockObject
35+
* @var Order|MockObject
3636
*/
3737
private $order;
3838

@@ -50,7 +50,7 @@ protected function setUp(): void
5050
{
5151
$this->plugin = new OrderRepositoryPlugin();
5252
$this->orderRepository = $this->createMock(OrderRepository::class);
53-
$this->order = $this->createMock(OrderInterface::class);
53+
$this->order = $this->createMock(Order::class);
5454
$this->billingAddress = $this->createMock(OrderAddressInterface::class);
5555
$this->orderItem = $this->createMock(OrderItemInterface::class);
5656
}
@@ -74,7 +74,7 @@ public function testBeforeSaveWithValidOrder(): void
7474

7575
// Setup order
7676
$this->order->method('getBillingAddress')->willReturn($this->billingAddress);
77-
$this->order->method('getItems')->willReturn([$this->orderItem]);
77+
$this->order->method('getAllVisibleItems')->willReturn([$this->orderItem]);
7878

7979
$result = $this->plugin->beforeSave($this->orderRepository, $this->order);
8080

@@ -123,7 +123,7 @@ public function testBeforeSaveWithMissingItems(): void
123123
$this->billingAddress->method('getCountryId')->willReturn('US');
124124

125125
$this->order->method('getBillingAddress')->willReturn($this->billingAddress);
126-
$this->order->method('getItems')->willReturn([]);
126+
$this->order->method('getAllVisibleItems')->willReturn([]);
127127

128128
$this->expectException(LocalizedException::class);
129129
$this->expectExceptionMessage('Please specify order items.');

0 commit comments

Comments
 (0)