Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCurrencySymbolOnProductPageCustomWebsite.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 AssertCurrencySymbolOnProductPageCustomWebsite extends AbstractConstraint
18 {
28  public function processAssert(
29  InjectableFixture $product,
30  BrowserInterface $browser,
31  CatalogProductView $catalogProductView,
32  array $currencySymbol = []
33  ) {
34  $website = $product->getDataFieldConfig('website_ids')['source']->getWebsites()[0];
35  $url = $_ENV['app_frontend_url'] . 'websites/' . $website->getCode() . '/' . $product->getUrlKey() . '.html';
36  $browser->open($url);
37  $priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();
38  $symbolOnPage = $priceBlock->getCurrencySymbol();
39 
40  \PHPUnit\Framework\Assert::assertEquals(
41  $currencySymbol['customWebsite'],
42  $symbolOnPage,
43  'Wrong Currency Symbol is displayed on Product page on Custom website.'
44  );
45  }
46 
52  public function toString()
53  {
54  return "Correct Currency Symbol displayed on Product page on Custom website.";
55  }
56 }
processAssert(InjectableFixture $product, BrowserInterface $browser, CatalogProductView $catalogProductView, array $currencySymbol=[])
$currencySymbol
Definition: matrix.phtml:14