Skip to content

Commit 25bc353

Browse files
committed
MAGETWO-62229: There is no Price on product page when product is out of stock
- Unit tests changes
1 parent ec13cd4 commit 25bc353

File tree

2 files changed

+2
-58
lines changed

2 files changed

+2
-58
lines changed

app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function setUp()
6767
{
6868
$this->product = $this->getMock(
6969
\Magento\Catalog\Model\Product::class,
70-
['getPriceInfo', '__wakeup', 'getCanShowPrice', 'isSalable'],
70+
['getPriceInfo', '__wakeup', 'getCanShowPrice'],
7171
[],
7272
'',
7373
false
@@ -178,11 +178,6 @@ public function testRenderMsrpDisabled()
178178
->with($this->equalTo($this->product))
179179
->will($this->returnValue(false));
180180

181-
$this->salableResolverMock->expects($this->any())
182-
->method('isSalable')
183-
->with($this->product)
184-
->willReturn(true);
185-
186181
$result = $this->object->toHtml();
187182

188183
//assert price wrapper
@@ -191,19 +186,6 @@ public function testRenderMsrpDisabled()
191186
$this->assertRegExp('/[final_price]/', $result);
192187
}
193188

194-
public function testNotSalableItem()
195-
{
196-
$this->salableResolverMock
197-
->expects($this->any())
198-
->method('isSalable')
199-
->with($this->product)
200-
->willReturn(false);
201-
202-
$result = $this->object->toHtml();
203-
204-
$this->assertNotEmpty($result);
205-
}
206-
207189
public function testRenderMsrpEnabled()
208190
{
209191
$priceType = $this->getMock('Magento\Msrp\Pricing\Price\MsrpPrice', [], [], '', false);
@@ -238,11 +220,6 @@ public function testRenderMsrpEnabled()
238220
->with('msrp_price', $this->product, $arguments)
239221
->will($this->returnValue($priceBoxRender));
240222

241-
$this->salableResolverMock->expects($this->any())
242-
->method('isSalable')
243-
->with($this->product)
244-
->willReturn(true);
245-
246223
$result = $this->object->toHtml();
247224

248225
//assert price wrapper
@@ -262,11 +239,6 @@ public function testRenderMsrpNotRegisteredException()
262239
->with($this->equalTo('msrp_price'))
263240
->will($this->throwException(new \InvalidArgumentException()));
264241

265-
$this->salableResolverMock->expects($this->any())
266-
->method('isSalable')
267-
->with($this->product)
268-
->willReturn(true);
269-
270242
$result = $this->object->toHtml();
271243

272244
//assert price wrapper

app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Render/FinalPriceBoxTest.php

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function setUp()
6767
{
6868
$this->product = $this->getMock(
6969
\Magento\Catalog\Model\Product::class,
70-
['getPriceInfo', '__wakeup', 'getCanShowPrice', 'isSalable'],
70+
['getPriceInfo', '__wakeup', 'getCanShowPrice'],
7171
[],
7272
'',
7373
false
@@ -178,11 +178,6 @@ public function testRenderMsrpDisabled()
178178
->with($this->equalTo($this->product))
179179
->will($this->returnValue(false));
180180

181-
$this->salableResolverMock->expects($this->any())
182-
->method('isSalable')
183-
->with($this->product)
184-
->willReturn(true);
185-
186181
$result = $this->object->toHtml();
187182

188183
//assert price wrapper
@@ -191,19 +186,6 @@ public function testRenderMsrpDisabled()
191186
$this->assertRegExp('/[final_price]/', $result);
192187
}
193188

194-
public function testNotSalableItem()
195-
{
196-
$this->salableResolverMock
197-
->expects($this->any())
198-
->method('isSalable')
199-
->with($this->product)
200-
->willReturn(false);
201-
202-
$result = $this->object->toHtml();
203-
204-
$this->assertNotEmpty($result);
205-
}
206-
207189
public function testRenderMsrpEnabled()
208190
{
209191
$priceType = $this->getMock('Magento\Msrp\Pricing\Price\MsrpPrice', [], [], '', false);
@@ -238,11 +220,6 @@ public function testRenderMsrpEnabled()
238220
->with('msrp_price', $this->product, $arguments)
239221
->will($this->returnValue($priceBoxRender));
240222

241-
$this->salableResolverMock->expects($this->any())
242-
->method('isSalable')
243-
->with($this->product)
244-
->willReturn(true);
245-
246223
$result = $this->object->toHtml();
247224

248225
//assert price wrapper
@@ -262,11 +239,6 @@ public function testRenderMsrpNotRegisteredException()
262239
->with($this->equalTo('msrp_price'))
263240
->will($this->throwException(new \InvalidArgumentException()));
264241

265-
$this->salableResolverMock->expects($this->any())
266-
->method('isSalable')
267-
->with($this->product)
268-
->willReturn(true);
269-
270242
$result = $this->object->toHtml();
271243

272244
//assert price wrapper

0 commit comments

Comments
 (0)