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


PHP CatalogProductView::getRelatedProductBlock方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that product is displayed in related products section.
  *
  * @param Browser $browser
  * @param CatalogProductSimple $product
  * @param InjectableFixture[] $relatedProducts
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(Browser $browser, CatalogProductSimple $product, array $relatedProducts, CatalogProductView $catalogProductView)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     foreach ($relatedProducts as $relatedProduct) {
         \PHPUnit_Framework_Assert::assertTrue($catalogProductView->getRelatedProductBlock()->getItemBlock($relatedProduct)->isVisible(), "Product {$relatedProduct->getName()} is absent in related products.");
     }
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:16,代码来源:AssertRelatedProductsSection.php

示例2: processAssert

 /**
  * Assert that product is not displayed in related products section.
  *
  * @param BrowserInterface $browser
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param InjectableFixture[]|null $promotedProducts
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductSimple $product, CatalogProductView $catalogProductView, array $promotedProducts = null)
 {
     if (!$promotedProducts) {
         $promotedProducts = $product->hasData('related_products') ? $product->getDataFieldConfig('related_products')['source']->getProducts() : [];
     }
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     foreach ($promotedProducts as $promotedProduct) {
         \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getRelatedProductBlock()->getItemBlock($promotedProduct)->isVisible(), "Product {$promotedProduct->getName()} is exist in related products.");
     }
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:19,代码来源:AssertProductAbsentRelatedProducts.php

示例3: assertRelatedSection

 /**
  * Check products on related section.
  *
  * @param CatalogProductView $catalogProductView
  * @param array $relatedProducts
  * @return void
  */
 protected function assertRelatedSection(CatalogProductView $catalogProductView, array $relatedProducts)
 {
     $errors = [];
     $relatedBlock = $catalogProductView->getRelatedProductBlock();
     foreach ($relatedProducts as $relatedProduct) {
         if (!$relatedBlock->getItemBlock($relatedProduct)->isVisible()) {
             $errors[] = "Product {$relatedProduct->getName()} is absent in up-sell section.";
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors));
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:18,代码来源:AssertRelatedProducts.php


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