Skip to content

Commit

Permalink
Fix testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Krielen committed Apr 15, 2020
1 parent 21ad13f commit 8f1020a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ public function testGetJsonConfig()
->with($priceInfoMock)
->willReturn(
[
'baseOldPrice' => [
'amount' => $amount,
],
'oldPrice' => [
'amount' => $amount,
],
Expand Down Expand Up @@ -362,6 +365,9 @@ private function getExpectedArray($productId, $amount, $priceQty, $percentage):
'currencyFormat' => '%s',
'optionPrices' => [
$productId => [
'baseOldPrice' => [
'amount' => $amount,
],
'oldPrice' => [
'amount' => $amount,
],
Expand All @@ -385,6 +391,9 @@ private function getExpectedArray($productId, $amount, $priceQty, $percentage):
],
'priceFormat' => [],
'prices' => [
'baseOldPrice' => [
'amount' => $amount,
],
'oldPrice' => [
'amount' => $amount,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ protected function setUp()
public function testGetFormattedPrices()
{
$expected = [
'baseOldPrice' => [
'amount' => 1000
],
'oldPrice' => [
'amount' => 500
],
Expand All @@ -54,8 +57,8 @@ public function testGetFormattedPrices()

$this->localeFormatMock->expects($this->atLeastOnce())
->method('getNumber')
->withConsecutive([500], [1000], [500])
->will($this->onConsecutiveCalls(500, 1000, 500));
->withConsecutive([1000],[500], [1000], [500])
->will($this->onConsecutiveCalls(1000,500, 1000, 500));

$this->assertEquals($expected, $this->model->getFormattedPrices($priceInfoMock));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,23 @@ public function childProductsDataProvider(): array
],
'expected_data' => [
[
'baseOldPrice' => ['amount' => 150],
'oldPrice' => ['amount' => 150],
'basePrice' => ['amount' => 50],
'finalPrice' => ['amount' => 50],
'tierPrices' => [],
'msrpPrice' => ['amount' => null],
],
[
'baseOldPrice' => ['amount' => 150],
'oldPrice' => ['amount' => 150],
'basePrice' => ['amount' => 58.55],
'finalPrice' => ['amount' => 58.55],
'tierPrices' => [],
'msrpPrice' => ['amount' => null],
],
[
'baseOldPrice' => ['amount' => 150],
'oldPrice' => ['amount' => 150],
'basePrice' => ['amount' => 75],
'finalPrice' => ['amount' => 75],
Expand Down

0 comments on commit 8f1020a

Please sign in to comment.