@@ -93,14 +93,15 @@ public function testGetSectionData()
93
93
$ productRewrite = [$ productId => ['rewrite ' => 'product ' ]];
94
94
$ itemData = ['item ' => 'data ' ];
95
95
$ shortcutButtonsHtml = '<span>Buttons</span> ' ;
96
+ $ websiteId = 100 ;
96
97
97
98
$ subtotalMock = $ this ->getMock ('\Magento\Framework\DataObject ' , ['getValue ' ], [], '' , false );
98
99
$ subtotalMock ->expects ($ this ->once ())->method ('getValue ' )->willReturn ($ subtotalValue );
99
100
$ totals = ['subtotal ' => $ subtotalMock ];
100
101
101
102
$ quoteMock = $ this ->getMock (
102
103
'\Magento\Quote\Model\Quote ' ,
103
- ['getTotals ' , 'getHasError ' , 'getAllVisibleItems ' ],
104
+ ['getTotals ' , 'getHasError ' , 'getAllVisibleItems ' , ' getStore ' ],
104
105
[],
105
106
'' ,
106
107
false
@@ -119,6 +120,10 @@ public function testGetSectionData()
119
120
$ quoteItemMock = $ this ->getMock ('\Magento\Quote\Model\Quote\Item ' , ['getProduct ' , 'getStoreId ' ], [], '' , false );
120
121
$ quoteMock ->expects ($ this ->once ())->method ('getAllVisibleItems ' )->willReturn ([$ quoteItemMock ]);
121
122
123
+ $ storeMock = $ this ->getMock (\Magento \Store \Model \System \Store::class, ['getWebsiteId ' ], [], '' , false );
124
+ $ storeMock ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ websiteId );
125
+ $ quoteMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ storeMock );
126
+
122
127
$ productMock = $ this ->getMock (
123
128
'\Magento\Catalog\Model\Product ' ,
124
129
['isVisibleInSiteVisibility ' , 'getId ' , 'setUrlDataObject ' ],
@@ -166,7 +171,8 @@ public function testGetSectionData()
166
171
['item ' => 'data ' ]
167
172
],
168
173
'extra_actions ' => '<span>Buttons</span> ' ,
169
- 'isGuestCheckoutAllowed ' => 1
174
+ 'isGuestCheckoutAllowed ' => 1 ,
175
+ 'website_id ' => $ websiteId
170
176
];
171
177
$ this ->assertEquals ($ expectedResult , $ this ->model ->getSectionData ());
172
178
}
@@ -180,6 +186,7 @@ public function testGetSectionDataWithCompositeProduct()
180
186
$ subtotalValue = 200 ;
181
187
$ productId = 10 ;
182
188
$ storeId = 20 ;
189
+ $ websiteId = 100 ;
183
190
184
191
$ productRewrite = [$ productId => ['rewrite ' => 'product ' ]];
185
192
$ itemData = ['item ' => 'data ' ];
@@ -190,7 +197,7 @@ public function testGetSectionDataWithCompositeProduct()
190
197
191
198
$ quoteMock = $ this ->getMock (
192
199
'\Magento\Quote\Model\Quote ' ,
193
- ['getTotals ' , 'getHasError ' , 'getAllVisibleItems ' ],
200
+ ['getTotals ' , 'getHasError ' , 'getAllVisibleItems ' , ' getStore ' ],
194
201
[],
195
202
'' ,
196
203
false
@@ -207,6 +214,10 @@ public function testGetSectionDataWithCompositeProduct()
207
214
$ quoteMock ->expects ($ this ->once ())->method ('getTotals ' )->willReturn ($ totals );
208
215
$ quoteMock ->expects ($ this ->once ())->method ('getHasError ' )->willReturn (false );
209
216
217
+ $ storeMock = $ this ->getMock (\Magento \Store \Model \System \Store::class, ['getWebsiteId ' ], [], '' , false );
218
+ $ storeMock ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ websiteId );
219
+ $ quoteMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ storeMock );
220
+
210
221
$ this ->checkoutCartMock ->expects ($ this ->once ())->method ('getSummaryQty ' )->willReturn ($ summaryQty );
211
222
$ this ->checkoutHelperMock ->expects ($ this ->once ())
212
223
->method ('formatPrice ' )
@@ -271,7 +282,8 @@ public function testGetSectionDataWithCompositeProduct()
271
282
['item ' => 'data ' ]
272
283
],
273
284
'extra_actions ' => '<span>Buttons</span> ' ,
274
- 'isGuestCheckoutAllowed ' => 1
285
+ 'isGuestCheckoutAllowed ' => 1 ,
286
+ 'website_id ' => $ websiteId
275
287
];
276
288
$ this ->assertEquals ($ expectedResult , $ this ->model ->getSectionData ());
277
289
}
0 commit comments