当前位置: 首页>>代码示例>>PHP>>正文


PHP CmsIndex::getCurrencyBlock方法代码示例

本文整理汇总了PHP中Magento\Cms\Test\Page\CmsIndex::getCurrencyBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CmsIndex::getCurrencyBlock方法的具体用法?PHP CmsIndex::getCurrencyBlock怎么用?PHP CmsIndex::getCurrencyBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Cms\Test\Page\CmsIndex的用法示例。


在下文中一共展示了CmsIndex::getCurrencyBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAssert

 /**
  * Assert that after applying changes, currency symbol changed on Product Details Page.
  *
  * @param CatalogProductSimple $product
  * @param BrowserInterface $browser
  * @param CmsIndex $cmsIndex
  * @param CatalogProductView $catalogProductView
  * @param CurrencySymbolEntity $currencySymbol
  * @return void
  */
 public function processAssert(CatalogProductSimple $product, BrowserInterface $browser, CmsIndex $cmsIndex, CatalogProductView $catalogProductView, CurrencySymbolEntity $currencySymbol)
 {
     $cmsIndex->open();
     $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol);
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $price = $catalogProductView->getViewBlock()->getPriceBlock()->getPrice();
     preg_match('`(.*?)\\d`', $price, $matches);
     $symbolOnPage = isset($matches[1]) ? $matches[1] : null;
     \PHPUnit_Framework_Assert::assertEquals($currencySymbol->getCustomCurrencySymbol(), $symbolOnPage, 'Wrong Currency Symbol is displayed on Product page.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:20,代码来源:AssertCurrencySymbolOnProductPage.php

示例2: processAssert

 /**
  * Assert that after applying changes, currency symbol changed on Catalog page
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param CatalogProductSimple $product
  * @param CurrencySymbolEntity $currencySymbol
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CurrencySymbolEntity $currencySymbol)
 {
     $categoryName = $product->getCategoryIds()[0];
     $cmsIndex->open();
     $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol);
     $cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $price = $catalogCategoryView->getListProductBlock()->getProductItem($product)->getPriceBlock()->getPrice('');
     preg_match('`(.*?)\\d`', $price, $matches);
     $symbolOnPage = isset($matches[1]) ? $matches[1] : null;
     \PHPUnit_Framework_Assert::assertEquals($currencySymbol->getCustomCurrencySymbol(), $symbolOnPage, 'Wrong Currency Symbol is displayed on Category page.');
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:20,代码来源:AssertCurrencySymbolOnCatalogPage.php

示例3: processAssert

 /**
  * Assert currency rate applied on catalog page.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param CatalogProductSimple $product
  * @param CurrencySymbolEntity $currencySymbol
  * @param string $basePrice
  * @param string $convertedPrice
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CurrencySymbolEntity $currencySymbol, $basePrice, $convertedPrice)
 {
     $categoryName = $product->getCategoryIds()[0];
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $priceBlock = $catalogCategoryView->getListProductBlock()->getProductItem($product)->getPriceBlock();
     $actualPrice = $priceBlock->getPrice('');
     \PHPUnit_Framework_Assert::assertEquals($basePrice, $actualPrice, 'Wrong price is displayed on Category page.');
     $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol);
     $cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $actualPrice = $priceBlock->getPrice('');
     \PHPUnit_Framework_Assert::assertEquals($convertedPrice, $actualPrice, 'Wrong price is displayed on Category page.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:24,代码来源:AssertCurrencyRateAppliedOnCatalogPage.php


注:本文中的Magento\Cms\Test\Page\CmsIndex::getCurrencyBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。