當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。