Skip to content

Commit 8f1020a

Browse files
author
Jack Krielen
committed
Fix testing.
1 parent 21ad13f commit 8f1020a

File tree

3 files changed

+17
-2
lines changed
  • app/code/Magento/ConfigurableProduct/Test/Unit
  • dev/tests/integration/testsuite/Magento/Swatches/Block/Product/Renderer/Configurable

3 files changed

+17
-2
lines changed

app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ public function testGetJsonConfig()
323323
->with($priceInfoMock)
324324
->willReturn(
325325
[
326+
'baseOldPrice' => [
327+
'amount' => $amount,
328+
],
326329
'oldPrice' => [
327330
'amount' => $amount,
328331
],
@@ -362,6 +365,9 @@ private function getExpectedArray($productId, $amount, $priceQty, $percentage):
362365
'currencyFormat' => '%s',
363366
'optionPrices' => [
364367
$productId => [
368+
'baseOldPrice' => [
369+
'amount' => $amount,
370+
],
365371
'oldPrice' => [
366372
'amount' => $amount,
367373
],
@@ -385,6 +391,9 @@ private function getExpectedArray($productId, $amount, $priceQty, $percentage):
385391
],
386392
'priceFormat' => [],
387393
'prices' => [
394+
'baseOldPrice' => [
395+
'amount' => $amount,
396+
],
388397
'oldPrice' => [
389398
'amount' => $amount,
390399
],

app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/Configurable/Variations/PricesTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ protected function setUp()
3333
public function testGetFormattedPrices()
3434
{
3535
$expected = [
36+
'baseOldPrice' => [
37+
'amount' => 1000
38+
],
3639
'oldPrice' => [
3740
'amount' => 500
3841
],
@@ -54,8 +57,8 @@ public function testGetFormattedPrices()
5457

5558
$this->localeFormatMock->expects($this->atLeastOnce())
5659
->method('getNumber')
57-
->withConsecutive([500], [1000], [500])
58-
->will($this->onConsecutiveCalls(500, 1000, 500));
60+
->withConsecutive([1000],[500], [1000], [500])
61+
->will($this->onConsecutiveCalls(1000,500, 1000, 500));
5962

6063
$this->assertEquals($expected, $this->model->getFormattedPrices($priceInfoMock));
6164
}

dev/tests/integration/testsuite/Magento/Swatches/Block/Product/Renderer/Configurable/PriceTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,23 @@ public function childProductsDataProvider(): array
116116
],
117117
'expected_data' => [
118118
[
119+
'baseOldPrice' => ['amount' => 150],
119120
'oldPrice' => ['amount' => 150],
120121
'basePrice' => ['amount' => 50],
121122
'finalPrice' => ['amount' => 50],
122123
'tierPrices' => [],
123124
'msrpPrice' => ['amount' => null],
124125
],
125126
[
127+
'baseOldPrice' => ['amount' => 150],
126128
'oldPrice' => ['amount' => 150],
127129
'basePrice' => ['amount' => 58.55],
128130
'finalPrice' => ['amount' => 58.55],
129131
'tierPrices' => [],
130132
'msrpPrice' => ['amount' => null],
131133
],
132134
[
135+
'baseOldPrice' => ['amount' => 150],
133136
'oldPrice' => ['amount' => 150],
134137
'basePrice' => ['amount' => 75],
135138
'finalPrice' => ['amount' => 75],

0 commit comments

Comments
 (0)