Skip to content

Commit f0e954d

Browse files
committed
Merge remote-tracking branch 'origin/bugs' into bugs
2 parents 660873f + b1dd4c9 commit f0e954d

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

app/code/Magento/Checkout/Test/Unit/Block/Cart/SidebarTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public function testGetTotalsHtml()
123123

124124
public function testGetConfig()
125125
{
126+
$websiteId = 100;
126127
$storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false);
127128

128129
$shoppingCartUrl = 'http://url.com/cart';
@@ -139,7 +140,8 @@ public function testGetConfig()
139140
'removeItemUrl' => $removeItemUrl,
140141
'imageTemplate' => $imageTemplate,
141142
'baseUrl' => $baseUrl,
142-
'minicartMaxItemsVisible' => 3
143+
'minicartMaxItemsVisible' => 3,
144+
'websiteId' => 100
143145
];
144146

145147
$valueMap = [
@@ -167,6 +169,13 @@ public function testGetConfig()
167169
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
168170
)->willReturn(3);
169171

172+
$quoteMock = $this->getMock('\Magento\Quote\Model\Quote', [], [], '', false);
173+
$this->checkoutSessionMock->expects($this->once())->method('getQuote')->willReturn($quoteMock);
174+
175+
$storeMock = $this->getMock(\Magento\Store\Model\System\Store::class, ['getWebsiteId'], [], '', false);
176+
$storeMock->expects($this->once())->method('getWebsiteId')->willReturn($websiteId);
177+
$quoteMock->expects($this->once())->method('getStore')->willReturn($storeMock);
178+
170179
$this->assertEquals($expectedResult, $this->model->getConfig());
171180
}
172181

app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ public function testGetSectionData()
9393
$productRewrite = [$productId => ['rewrite' => 'product']];
9494
$itemData = ['item' => 'data'];
9595
$shortcutButtonsHtml = '<span>Buttons</span>';
96+
$websiteId = 100;
9697

9798
$subtotalMock = $this->getMock('\Magento\Framework\DataObject', ['getValue'], [], '', false);
9899
$subtotalMock->expects($this->once())->method('getValue')->willReturn($subtotalValue);
99100
$totals = ['subtotal' => $subtotalMock];
100101

101102
$quoteMock = $this->getMock(
102103
'\Magento\Quote\Model\Quote',
103-
['getTotals', 'getHasError', 'getAllVisibleItems'],
104+
['getTotals', 'getHasError', 'getAllVisibleItems', 'getStore'],
104105
[],
105106
'',
106107
false
@@ -119,6 +120,10 @@ public function testGetSectionData()
119120
$quoteItemMock = $this->getMock('\Magento\Quote\Model\Quote\Item', ['getProduct', 'getStoreId'], [], '', false);
120121
$quoteMock->expects($this->once())->method('getAllVisibleItems')->willReturn([$quoteItemMock]);
121122

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+
122127
$productMock = $this->getMock(
123128
'\Magento\Catalog\Model\Product',
124129
['isVisibleInSiteVisibility', 'getId', 'setUrlDataObject'],
@@ -166,7 +171,8 @@ public function testGetSectionData()
166171
['item' => 'data']
167172
],
168173
'extra_actions' => '<span>Buttons</span>',
169-
'isGuestCheckoutAllowed' => 1
174+
'isGuestCheckoutAllowed' => 1,
175+
'website_id' => $websiteId
170176
];
171177
$this->assertEquals($expectedResult, $this->model->getSectionData());
172178
}
@@ -180,6 +186,7 @@ public function testGetSectionDataWithCompositeProduct()
180186
$subtotalValue = 200;
181187
$productId = 10;
182188
$storeId = 20;
189+
$websiteId = 100;
183190

184191
$productRewrite = [$productId => ['rewrite' => 'product']];
185192
$itemData = ['item' => 'data'];
@@ -190,7 +197,7 @@ public function testGetSectionDataWithCompositeProduct()
190197

191198
$quoteMock = $this->getMock(
192199
'\Magento\Quote\Model\Quote',
193-
['getTotals', 'getHasError', 'getAllVisibleItems'],
200+
['getTotals', 'getHasError', 'getAllVisibleItems', 'getStore'],
194201
[],
195202
'',
196203
false
@@ -207,6 +214,10 @@ public function testGetSectionDataWithCompositeProduct()
207214
$quoteMock->expects($this->once())->method('getTotals')->willReturn($totals);
208215
$quoteMock->expects($this->once())->method('getHasError')->willReturn(false);
209216

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+
210221
$this->checkoutCartMock->expects($this->once())->method('getSummaryQty')->willReturn($summaryQty);
211222
$this->checkoutHelperMock->expects($this->once())
212223
->method('formatPrice')
@@ -271,7 +282,8 @@ public function testGetSectionDataWithCompositeProduct()
271282
['item' => 'data']
272283
],
273284
'extra_actions' => '<span>Buttons</span>',
274-
'isGuestCheckoutAllowed' => 1
285+
'isGuestCheckoutAllowed' => 1,
286+
'website_id' => $websiteId
275287
];
276288
$this->assertEquals($expectedResult, $this->model->getSectionData());
277289
}

0 commit comments

Comments
 (0)