本文整理汇总了PHP中mage\catalog\test\page\product\CatalogProductView::getUpsellBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductView::getUpsellBlock方法的具体用法?PHP CatalogProductView::getUpsellBlock怎么用?PHP CatalogProductView::getUpsellBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mage\catalog\test\page\product\CatalogProductView
的用法示例。
在下文中一共展示了CatalogProductView::getUpsellBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Assert that products are displayed in up-sell section.
*
* @param Browser $browser
* @param FixtureInterface $product
* @param array $upSellProducts
* @param CatalogProductView $catalogProductView
* @return void
*/
public function processAssert(Browser $browser, FixtureInterface $product, array $upSellProducts, CatalogProductView $catalogProductView)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
foreach ($upSellProducts as $upSellProduct) {
\PHPUnit_Framework_Assert::assertTrue($catalogProductView->getUpsellBlock()->getItemBlock($upSellProduct)->isVisible(), "Product {$upSellProduct->getName()} is absent in up-sells products.");
}
}
示例2: processAssert
/**
* Assert that product is not displayed in up-sell 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('up_sell_products') ? $product->getDataFieldConfig('up_sell_products')['source']->getProducts() : [];
}
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
foreach ($promotedProducts as $promotedProduct) {
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getUpsellBlock()->getItemBlock($promotedProduct)->isVisible(), 'Product \'' . $promotedProduct->getName() . '\' is exist in up-sells products.');
}
}
示例3: assertUpSellSectionAbsent
/**
* Check that upSell section is absent.
*
* @param CatalogProductView $catalogProductView
* @return void
*/
protected function assertUpSellSectionAbsent(CatalogProductView $catalogProductView)
{
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getUpsellBlock()->isVisible());
}