9
9
10
10
use Magento \Framework \Exception \LocalizedException ;
11
11
use Magento \Sales \Api \Data \OrderAddressInterface ;
12
- use Magento \Sales \Api \Data \OrderInterface ;
13
12
use Magento \Sales \Api \Data \OrderItemInterface ;
13
+ use Magento \Sales \Model \Order ;
14
14
use Magento \Sales \Model \OrderRepository ;
15
15
use PHPUnit \Framework \MockObject \MockObject ;
16
16
use PHPUnit \Framework \TestCase ;
@@ -32,7 +32,7 @@ class OrderRepositoryPluginTest extends TestCase
32
32
private $ orderRepository ;
33
33
34
34
/**
35
- * @var OrderInterface |MockObject
35
+ * @var Order |MockObject
36
36
*/
37
37
private $ order ;
38
38
@@ -50,7 +50,7 @@ protected function setUp(): void
50
50
{
51
51
$ this ->plugin = new OrderRepositoryPlugin ();
52
52
$ this ->orderRepository = $ this ->createMock (OrderRepository::class);
53
- $ this ->order = $ this ->createMock (OrderInterface ::class);
53
+ $ this ->order = $ this ->createMock (Order ::class);
54
54
$ this ->billingAddress = $ this ->createMock (OrderAddressInterface::class);
55
55
$ this ->orderItem = $ this ->createMock (OrderItemInterface::class);
56
56
}
@@ -74,7 +74,7 @@ public function testBeforeSaveWithValidOrder(): void
74
74
75
75
// Setup order
76
76
$ this ->order ->method ('getBillingAddress ' )->willReturn ($ this ->billingAddress );
77
- $ this ->order ->method ('getItems ' )->willReturn ([$ this ->orderItem ]);
77
+ $ this ->order ->method ('getAllVisibleItems ' )->willReturn ([$ this ->orderItem ]);
78
78
79
79
$ result = $ this ->plugin ->beforeSave ($ this ->orderRepository , $ this ->order );
80
80
@@ -123,7 +123,7 @@ public function testBeforeSaveWithMissingItems(): void
123
123
$ this ->billingAddress ->method ('getCountryId ' )->willReturn ('US ' );
124
124
125
125
$ this ->order ->method ('getBillingAddress ' )->willReturn ($ this ->billingAddress );
126
- $ this ->order ->method ('getItems ' )->willReturn ([]);
126
+ $ this ->order ->method ('getAllVisibleItems ' )->willReturn ([]);
127
127
128
128
$ this ->expectException (LocalizedException::class);
129
129
$ this ->expectExceptionMessage ('Please specify order items. ' );
0 commit comments