Skip to content

Commit f920af2

Browse files
author
Magento CICD
authored
MAGETWO-64845: [GitHub][PR] Fix #7371 #8593
2 parents e567c1d + 95dc16b commit f920af2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

app/code/Magento/CatalogRule/Pricing/Price/CatalogRulePrice.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public function getValue()
9999
$this->product->getId()
100100
);
101101
$this->value = $this->value ? floatval($this->value) : false;
102-
if ($this->value) {
103-
$this->value = $this->priceCurrency->convertAndRound($this->value);
104-
}
102+
}
103+
if ($this->value) {
104+
$this->value = $this->priceCurrency->convertAndRound($this->value);
105105
}
106106
}
107107

app/code/Magento/CatalogRule/Test/Unit/Pricing/Price/CatalogRulePriceTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,20 @@ public function testGetValue()
208208

209209
public function testGetValueFromData()
210210
{
211+
$catalogRulePrice = 7.1;
212+
$convertedPrice = 5.84;
213+
214+
$this->priceCurrencyMock->expects($this->any())
215+
->method('convertAndRound')
216+
->with($catalogRulePrice)
217+
->will($this->returnValue($convertedPrice));
218+
211219
$this->saleableItemMock->expects($this->once())->method('hasData')
212220
->with('catalog_rule_price')->willReturn(true);
213221
$this->saleableItemMock->expects($this->once())->method('getData')
214-
->with('catalog_rule_price')->willReturn('7.1');
222+
->with('catalog_rule_price')->willReturn($catalogRulePrice);
215223

216-
$this->assertEquals(7.1, $this->object->getValue());
224+
$this->assertEquals($convertedPrice, $this->object->getValue());
217225
}
218226

219227
public function testGetAmountNoBaseAmount()

0 commit comments

Comments
 (0)