Skip to content

Commit 86d38f6

Browse files
committed
MAGETWO-96847: [2.3.x] Special price does not work when "default config" scope timezone does not match "website" scope timezone
- Fix tests
1 parent ce547ae commit 86d38f6

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Bundle\Test\Unit\Pricing\Price;
77

88
use \Magento\Bundle\Pricing\Price\SpecialPrice;
9+
use Magento\Store\Api\Data\WebsiteInterface;
910

1011
class SpecialPriceTest extends \PHPUnit\Framework\TestCase
1112
{
@@ -77,12 +78,6 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva
7778
->method('getSpecialPrice')
7879
->will($this->returnValue($specialPrice));
7980

80-
$store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
81-
->disableOriginalConstructor()
82-
->getMock();
83-
$this->saleable->expects($this->once())
84-
->method('getStore')
85-
->will($this->returnValue($store));
8681
$this->saleable->expects($this->once())
8782
->method('getSpecialFromDate')
8883
->will($this->returnValue($specialFromDate));
@@ -92,7 +87,7 @@ public function testGetValue($regularPrice, $specialPrice, $isScopeDateInInterva
9287

9388
$this->localeDate->expects($this->once())
9489
->method('isScopeDateInInterval')
95-
->with($store, $specialFromDate, $specialToDate)
90+
->with(WebsiteInterface::ADMIN_CODE, $specialFromDate, $specialToDate)
9691
->will($this->returnValue($isScopeDateInInterval));
9792

9893
$this->priceCurrencyMock->expects($this->never())

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*
1919
* @api
2020
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2122
* @since 100.0.2
2223
*/
2324
class Price

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<element name="productOptionAreaInput" type="textarea" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//textarea" parameterized="true"/>
2929
<element name="productOptionFile" type="file" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'OptionFile')]/../div[@class='control']//input[@type='file']" parameterized="true"/>
3030
<element name="productOptionSelect" type="select" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//select" parameterized="true"/>
31+
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>
3132

3233

3334
<!-- The parameter is the nth custom option that you want to get -->

app/code/Magento/GroupedProduct/Test/Unit/Model/Product/Type/Grouped/PriceTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testGetFinalPrice(
6464
$expectedFinalPrice
6565
) {
6666
$rawFinalPrice = 10;
67-
$rawPriceCheckStep = 6;
67+
$rawPriceCheckStep = 5;
6868

6969
$this->productMock->expects(
7070
$this->any()
@@ -155,7 +155,7 @@ public function getFinalPriceDataProvider()
155155
'custom_option_null' => [
156156
'associatedProducts' => [],
157157
'options' => [[], []],
158-
'expectedPriceCall' => 6, /* product call number to check final price formed correctly */
158+
'expectedPriceCall' => 5, /* product call number to check final price formed correctly */
159159
'expectedFinalPrice' => 10, /* 10(product price) + 2(options count) * 5(qty) * 5(option price) */
160160
],
161161
'custom_option_exist' => [
@@ -165,7 +165,7 @@ public function getFinalPriceDataProvider()
165165
['associated_product_2', $optionMock],
166166
['associated_product_3', $optionMock],
167167
],
168-
'expectedPriceCall' => 16, /* product call number to check final price formed correctly */
168+
'expectedPriceCall' => 15, /* product call number to check final price formed correctly */
169169
'expectedFinalPrice' => 35, /* 10(product price) + 2(options count) * 5(qty) * 5(option price) */
170170
]
171171
];

0 commit comments

Comments
 (0)