Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCurrencySymbolOnProductPageMainWebsite.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Fixture\InjectableFixture;
10 use Magento\Catalog\Test\Page\Product\CatalogProductView;
11 use Magento\Mtf\Client\BrowserInterface;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
17 class AssertCurrencySymbolOnProductPageMainWebsite extends AbstractConstraint
18 {
28  public function processAssert(
29  InjectableFixture $product,
30  BrowserInterface $browser,
31  CatalogProductView $catalogProductView,
32  array $currencySymbol = []
33  ) {
34  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
35  $priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();
36  $symbolOnPage = $priceBlock->getCurrencySymbol();
37 
38  \PHPUnit\Framework\Assert::assertEquals(
39  $currencySymbol['mainWebsite'],
40  $symbolOnPage,
41  'Wrong Currency Symbol is displayed on Product page on the Main Website.'
42  );
43  }
44 
50  public function toString()
51  {
52  return "Correct Currency Symbol displayed on Product page on the Main Website.";
53  }
54 }
$currencySymbol
Definition: matrix.phtml:14
processAssert(InjectableFixture $product, BrowserInterface $browser, CatalogProductView $catalogProductView, array $currencySymbol=[])