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
Directory
Test
Constraint
AssertCurrencyRateAppliedOnCatalogPage.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Directory\Test\Constraint
;
8
9
use Magento\Cms\Test\Page\CmsIndex;
10
use Magento\Mtf\Constraint\AbstractConstraint;
11
use
Magento\Catalog\Test\Fixture\CatalogProductSimple
;
12
use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
13
use Magento\CurrencySymbol\Test\Fixture\CurrencySymbolEntity;
14
18
class
AssertCurrencyRateAppliedOnCatalogPage
extends
AbstractConstraint
19
{
31
public
function
processAssert
(
32
CmsIndex $cmsIndex,
33
CatalogCategoryView $catalogCategoryView,
34
CatalogProductSimple
$product
,
35
CurrencySymbolEntity
$currencySymbol
,
36
$basePrice,
37
$convertedPrice
38
) {
39
$categoryName =
$product
->getCategoryIds()[0];
40
$cmsIndex->open();
41
$cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
42
$priceBlock = $catalogCategoryView->getListProductBlock()->getProductItem(
$product
)->getPriceBlock();
43
$actualPrice = $priceBlock->getPrice(
''
);
44
45
\PHPUnit\Framework\Assert::assertEquals(
46
$basePrice,
47
$actualPrice,
48
'Wrong price is displayed on Category page.'
49
);
50
51
$cmsIndex->getCurrencyBlock()->switchCurrency(
$currencySymbol
);
52
$cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
53
$actualPrice = $priceBlock->getPrice(
''
);
54
55
\PHPUnit\Framework\Assert::assertEquals(
56
$convertedPrice,
57
$actualPrice,
58
'Wrong price is displayed on Category page.'
59
);
60
}
61
67
public
function
toString
()
68
{
69
return
"Currency rate has been applied correctly on Catalog page."
;
70
}
71
}
Magento\Directory\Test\Constraint\AssertCurrencyRateAppliedOnCatalogPage\toString
toString()
Definition:
AssertCurrencyRateAppliedOnCatalogPage.php:67
$currencySymbol
$currencySymbol
Definition:
matrix.phtml:14
Magento\Catalog\Test\Fixture\CatalogProductSimple
Definition:
CustomAttribute.php:7
Magento\Directory\Test\Constraint\AssertCurrencyRateAppliedOnCatalogPage
Definition:
AssertCurrencyRateAppliedOnCatalogPage.php:18
Magento\Directory\Test\Constraint
Definition:
AssertCurrencyRateAppliedOnCatalogPage.php:7
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Directory\Test\Constraint\AssertCurrencyRateAppliedOnCatalogPage\processAssert
processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CurrencySymbolEntity $currencySymbol, $basePrice, $convertedPrice)
Definition:
AssertCurrencyRateAppliedOnCatalogPage.php:31