本文整理汇总了PHP中Magento\Catalog\Test\Page\Product\CatalogProductView::getGroupedViewBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductView::getGroupedViewBlock方法的具体用法?PHP CatalogProductView::getGroupedViewBlock怎么用?PHP CatalogProductView::getGroupedViewBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Test\Page\Product\CatalogProductView
的用法示例。
在下文中一共展示了CatalogProductView::getGroupedViewBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Assert that default qty for sub products in grouped product displays according to dataset on product page.
*
* @param CatalogProductView $groupedProductView
* @param CatalogProductGrouped $product
* @param Browser $browser
* @return void
*/
public function processAssert(CatalogProductView $groupedProductView, CatalogProductGrouped $product, Browser $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$groupedBlock = $groupedProductView->getGroupedViewBlock()->getGroupedProductBlock();
$groupedProduct = $product->getData();
foreach ($groupedProduct['associated']['assigned_products'] as $item) {
\PHPUnit_Framework_Assert::assertEquals($groupedBlock->getQty($item['id']), $item['qty'], 'Default qty for sub product "' . $item['name'] . '" in grouped product according to dataset.');
}
}
示例2: processAssertPrice
/**
* Verify product price on grouped product view page
*
* @param CatalogProductGrouped $product
* @param CatalogProductView $catalogProductView
* @param AssertPriceOnProductPageInterface $object
* @param Browser $browser
* @param string $typePrice [optional]
* @return bool|string
*/
protected function processAssertPrice(CatalogProductGrouped $product, CatalogProductView $catalogProductView, AssertPriceOnProductPageInterface $object, Browser $browser, $typePrice = '')
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$groupedData = $product->getAssociated();
/** @var InjectableFixture $subProduct */
foreach ($groupedData['products'] as $key => $subProduct) {
//Process assertions
$catalogProductView->getGroupedViewBlock()->{'item' . $typePrice . 'PriceProductBlock'}(++$key);
$object->setErrorMessage(sprintf($this->errorMessage, $subProduct->getData('name')));
$object->assertPrice($subProduct, $catalogProductView, 'Grouped');
}
}