-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-60283: Prices of configurable product are incorrectly recalcu…
…lated when display currency is changed
- Loading branch information
1 parent
8bde202
commit 1527713
Showing
7 changed files
with
137 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...al/tests/app/Magento/Directory/Test/Constraint/AssertCurrencyRateAppliedOnProductPage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Directory\Test\Constraint; | ||
|
||
use Magento\Catalog\Test\Page\Product\CatalogProductView; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
use Magento\Mtf\Fixture\InjectableFixture; | ||
|
||
/** | ||
* Assert currency rate applied on product page. | ||
*/ | ||
class AssertCurrencyRateAppliedOnProductPage extends AbstractConstraint | ||
{ | ||
/** | ||
* Assert currency rate applied on product page. | ||
* | ||
* @param BrowserInterface $browser | ||
* @param InjectableFixture $product | ||
* @param CatalogProductView $view | ||
* @param string $basePrice | ||
*/ | ||
public function processAssert( | ||
BrowserInterface $browser, | ||
InjectableFixture $product, | ||
CatalogProductView $view, | ||
$basePrice | ||
) { | ||
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); | ||
|
||
\PHPUnit_Framework_Assert::assertEquals( | ||
$basePrice, | ||
$view->getViewBlock()->getPriceBlock()->getPrice(''), | ||
'Wrong price is displayed on Product page.' | ||
); | ||
} | ||
|
||
/** | ||
* Returns a string representation of successful assertion. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return "Currency rate has been applied correctly on Product page."; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
dev/tests/functional/tests/app/Magento/Directory/Test/Repository/ConfigData.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> | ||
<repository class="Magento\Config\Test\Repository\ConfigData"> | ||
<dataset name="config_base_currency_us_display_currency_uah"> | ||
<field name="currency/options/allow" xsi:type="array"> | ||
<item name="scope" xsi:type="string">currency</item> | ||
<item name="scope_id" xsi:type="number">1</item> | ||
<item name="value" xsi:type="array"> | ||
<item name="Ukrainian Hryvnia" xsi:type="string">UAH</item> | ||
</item> | ||
</field> | ||
<field name="currency/options/base" xsi:type="array"> | ||
<item name="scope" xsi:type="string">currency</item> | ||
<item name="label" xsi:type="string">US Dollar</item> | ||
<item name="scope_id" xsi:type="number">1</item> | ||
<item name="value" xsi:type="string">USD</item> | ||
</field> | ||
<field name="currency/options/default" xsi:type="array"> | ||
<item name="scope" xsi:type="string">currency</item> | ||
<item name="label" xsi:type="string">Ukrainian Hryvnia</item> | ||
<item name="scope_id" xsi:type="number">1</item> | ||
<item name="value" xsi:type="string">UAH</item> | ||
</field> | ||
</dataset> | ||
</repository> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters