Skip to content

Commit e2fda94

Browse files
MTO-108: [Test] Observe Different Base Currency per Website
- Defects fixed
1 parent 25e6257 commit e2fda94

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Price.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,18 @@ public function getPriceTo($currency = '$')
111111
}
112112

113113
/**
114-
* Get currency symbol.
114+
* Get currency symbol from price block on the product page.
115115
*
116-
* @param string $price
117-
* @return string
116+
* @param string $currency
117+
* @return array|null
118118
*/
119-
public function getCurrencySymbol($price)
119+
public function getCurrencySymbol($currency = '$')
120120
{
121+
$price = $this->getPrice($currency);
121122
preg_match('`(.*?)\d`', $price, $matches);
122-
return $matches;
123+
return $matches[1];
123124
}
124125

125-
126-
127126
/**
128127
* Get price excluding tax.
129128
*

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPageCustomWebsite.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ public function processAssert(
3535
$url = $_ENV['app_frontend_url'] . 'websites/' . $website->getCode() . '/' . $product->getUrlKey() . '.html';
3636
$browser->open($url);
3737
$priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();
38-
$price = $priceBlock->getPrice('');
39-
$symbolOnPage = $priceBlock->getCurrencySymbol($price);
38+
$symbolOnPage = $priceBlock->getCurrencySymbol('');
4039

4140
\PHPUnit_Framework_Assert::assertEquals(
4241
$currencySymbol['customWebsite'],
43-
$symbolOnPage[1],
42+
$symbolOnPage,
4443
'Wrong Currency Symbol is displayed on Product page on Custom website.'
4544
);
4645
}

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPageMainWebsite.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ public function processAssert(
3333
) {
3434
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
3535
$priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();
36-
$price = $priceBlock->getPrice('');
37-
$symbolOnPage = $priceBlock->getCurrencySymbol($price);
36+
$symbolOnPage = $priceBlock->getCurrencySymbol('');
3837

3938
\PHPUnit_Framework_Assert::assertEquals(
4039
$currencySymbol['mainWebsite'],
41-
$symbolOnPage[1],
40+
$symbolOnPage,
4241
'Wrong Currency Symbol is displayed on Product page on the Main Website.'
4342
);
4443
}

0 commit comments

Comments
 (0)