Skip to content

Commit

Permalink
MAGETWO-64845: [GitHub][PR] Fix #7371 #8593
Browse files Browse the repository at this point in the history
 - Merge Pull Request #8593 from rossluk/magento2:patch-1
  • Loading branch information
Oleksii Korshenko committed Feb 24, 2017
2 parents f59e74c + 92a6e89 commit 95dc16b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public function getValue()
$this->product->getId()
);
$this->value = $this->value ? floatval($this->value) : false;
if ($this->value) {
$this->value = $this->priceCurrency->convertAndRound($this->value);
}
}
if ($this->value) {
$this->value = $this->priceCurrency->convertAndRound($this->value);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,20 @@ public function testGetValue()

public function testGetValueFromData()
{
$catalogRulePrice = 7.1;
$convertedPrice = 5.84;

$this->priceCurrencyMock->expects($this->any())
->method('convertAndRound')
->with($catalogRulePrice)
->will($this->returnValue($convertedPrice));

$this->saleableItemMock->expects($this->once())->method('hasData')
->with('catalog_rule_price')->willReturn(true);
$this->saleableItemMock->expects($this->once())->method('getData')
->with('catalog_rule_price')->willReturn('7.1');
->with('catalog_rule_price')->willReturn($catalogRulePrice);

$this->assertEquals(7.1, $this->object->getValue());
$this->assertEquals($convertedPrice, $this->object->getValue());
}

public function testGetAmountNoBaseAmount()
Expand Down

0 comments on commit 95dc16b

Please sign in to comment.