@@ -90,6 +90,7 @@ public function testGetSectionData()
90
90
$ subtotalValue = 200 ;
91
91
$ productId = 10 ;
92
92
$ storeId = 20 ;
93
+ $ websiteId = 100 ;
93
94
$ productRewrite = [$ productId => ['rewrite ' => 'product ' ]];
94
95
$ itemData = ['item ' => 'data ' ];
95
96
$ shortcutButtonsHtml = '<span>Buttons</span> ' ;
@@ -100,7 +101,7 @@ public function testGetSectionData()
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
@@ -109,6 +110,10 @@ public function testGetSectionData()
109
110
$ quoteMock ->expects ($ this ->once ())->method ('getTotals ' )->willReturn ($ totals );
110
111
$ quoteMock ->expects ($ this ->once ())->method ('getHasError ' )->willReturn (false );
111
112
113
+ $ storeMock = $ this ->getMock (\Magento \Store \Model \System \Store::class, ['getWebsiteId ' ], [], '' , false );
114
+ $ storeMock ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ websiteId );
115
+ $ quoteMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ storeMock );
116
+
112
117
$ this ->checkoutCartMock ->expects ($ this ->once ())->method ('getSummaryQty ' )->willReturn ($ summaryQty );
113
118
$ this ->checkoutHelperMock ->expects ($ this ->once ())
114
119
->method ('formatPrice ' )
@@ -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
@@ -216,6 +223,10 @@ public function testGetSectionDataWithCompositeProduct()
216
223
217
224
$ quoteMock ->expects ($ this ->once ())->method ('getAllVisibleItems ' )->willReturn ([$ quoteItemMock ]);
218
225
226
+ $ storeMock = $ this ->getMock (\Magento \Store \Model \System \Store::class, ['getWebsiteId ' ], [], '' , false );
227
+ $ storeMock ->expects ($ this ->once ())->method ('getWebsiteId ' )->willReturn ($ websiteId );
228
+ $ quoteMock ->expects ($ this ->once ())->method ('getStore ' )->willReturn ($ storeMock );
229
+
219
230
$ productMock = $ this ->getMock (
220
231
'\Magento\Catalog\Model\Product ' ,
221
232
['isVisibleInSiteVisibility ' , 'getId ' , 'setUrlDataObject ' ],
@@ -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