Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
CurrencySymbol
Test
Constraint
AssertCurrencySymbolOnCatalogPage.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CurrencySymbol\Test\Constraint
;
8
9
use
Magento\Catalog\Test\Fixture\CatalogProductSimple
;
10
use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
11
use Magento\Cms\Test\Page\CmsIndex;
12
use Magento\CurrencySymbol\Test\Fixture\CurrencySymbolEntity;
13
use Magento\Mtf\Constraint\AbstractConstraint;
14
19
class
AssertCurrencySymbolOnCatalogPage
extends
AbstractConstraint
20
{
30
public
function
processAssert
(
31
CmsIndex $cmsIndex,
32
CatalogCategoryView $catalogCategoryView,
33
CatalogProductSimple
$product
,
34
CurrencySymbolEntity
$currencySymbol
35
) {
36
$categoryName =
$product
->getCategoryIds()[0];
37
$cmsIndex->open();
38
$cmsIndex->getCurrencyBlock()->switchCurrency(
$currencySymbol
);
39
$cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
40
$price
= $catalogCategoryView->getListProductBlock()->getProductItem(
$product
)->getPriceBlock()->getPrice(
''
);
41
preg_match(
'`(.*?)\d`'
,
$price
, $matches);
42
43
$symbolOnPage = isset($matches[1]) ? $matches[1] :
null
;
44
\PHPUnit\Framework\Assert::assertEquals(
45
$currencySymbol
->getCustomCurrencySymbol(),
46
$symbolOnPage,
47
'Wrong Currency Symbol is displayed on Category page.'
48
);
49
}
50
56
public
function
toString
()
57
{
58
return
"Currency Symbol has been changed on Catalog page."
;
59
}
60
}
Magento\CurrencySymbol\Test\Constraint\AssertCurrencySymbolOnCatalogPage
Definition:
AssertCurrencySymbolOnCatalogPage.php:19
$price
$price
Definition:
product_alert.php:10
$currencySymbol
$currencySymbol
Definition:
matrix.phtml:14
Magento\Catalog\Test\Fixture\CatalogProductSimple
Definition:
CustomAttribute.php:7
Magento\CurrencySymbol\Test\Constraint
Definition:
AssertCurrencySymbolOnCatalogPage.php:7
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\CurrencySymbol\Test\Constraint\AssertCurrencySymbolOnCatalogPage\processAssert
processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CurrencySymbolEntity $currencySymbol)
Definition:
AssertCurrencySymbolOnCatalogPage.php:30
Magento\CurrencySymbol\Test\Constraint\AssertCurrencySymbolOnCatalogPage\toString
toString()
Definition:
AssertCurrencySymbolOnCatalogPage.php:56