@@ -22,11 +22,6 @@ class CartPluginTest extends \PHPUnit_Framework_TestCase
22
22
*/
23
23
private $ checkoutSessionMock ;
24
24
25
- /**
26
- * @var \PHPUnit_Framework_MockObject_MockObject
27
- */
28
- private $ typeMultishippingMock ;
29
-
30
25
/**
31
26
* @var \PHPUnit_Framework_MockObject_MockObject
32
27
*/
@@ -36,18 +31,10 @@ protected function setUp()
36
31
{
37
32
$ this ->cartRepositoryMock = $ this ->getMock (\Magento \Quote \Api \CartRepositoryInterface::class);
38
33
$ this ->checkoutSessionMock = $ this ->getMock (\Magento \Checkout \Model \Session::class, [], [], '' , false );
39
- $ this ->typeMultishippingMock = $ this ->getMock (
40
- \Magento \Multishipping \Model \Checkout \Type \Multishipping::class,
41
- [],
42
- [],
43
- '' ,
44
- false
45
- );
46
34
$ this ->addressRepositoryMock = $ this ->getMock (\Magento \Customer \Api \AddressRepositoryInterface::class);
47
35
$ this ->model = new \Magento \Multishipping \Model \Cart \Controller \CartPlugin (
48
36
$ this ->cartRepositoryMock ,
49
37
$ this ->checkoutSessionMock ,
50
- $ this ->typeMultishippingMock ,
51
38
$ this ->addressRepositoryMock
52
39
);
53
40
}
@@ -63,8 +50,7 @@ public function testBeforeDispatch()
63
50
'getAllShippingAddresses ' ,
64
51
'removeAddress ' ,
65
52
'getShippingAddress ' ,
66
- 'setIsMultiShipping ' ,
67
- 'collectTotals '
53
+ 'getCustomer '
68
54
],
69
55
[],
70
56
'' ,
@@ -81,10 +67,9 @@ public function testBeforeDispatch()
81
67
82
68
$ shippingAddressMock = $ this ->getMock (\Magento \Quote \Model \Quote \Address::class, [], [], '' , false );
83
69
$ quoteMock ->expects ($ this ->once ())->method ('getShippingAddress ' )->willReturn ($ shippingAddressMock );
84
-
85
- $ this ->typeMultishippingMock ->expects ($ this ->once ())
86
- ->method ('getCustomerDefaultShippingAddress ' )
87
- ->willReturn ($ customerAddressId );
70
+ $ customerMock = $ this ->getMock (\Magento \Customer \Api \Data \CustomerInterface::class);
71
+ $ quoteMock ->expects ($ this ->once ())->method ('getCustomer ' )->willReturn ($ customerMock );
72
+ $ customerMock ->expects ($ this ->once ())->method ('getDefaultShipping ' )->willReturn ($ customerAddressId );
88
73
89
74
$ customerAddressMock = $ this ->getMock (\Magento \Customer \Api \Data \AddressInterface::class);
90
75
$ this ->addressRepositoryMock ->expects ($ this ->once ())
0 commit comments