99
1010use Magento \Framework \Exception \LocalizedException ;
1111use Magento \Sales \Api \Data \OrderAddressInterface ;
12- use Magento \Sales \Api \Data \OrderInterface ;
1312use Magento \Sales \Api \Data \OrderItemInterface ;
13+ use Magento \Sales \Model \Order ;
1414use Magento \Sales \Model \OrderRepository ;
1515use PHPUnit \Framework \MockObject \MockObject ;
1616use 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