本文整理匯總了PHP中Magento\Catalog\Test\Page\Category\CatalogCategoryView::getMsrpListProductBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogCategoryView::getMsrpListProductBlock方法的具體用法?PHP CatalogCategoryView::getMsrpListProductBlock怎麽用?PHP CatalogCategoryView::getMsrpListProductBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Catalog\Test\Page\Category\CatalogCategoryView
的用法示例。
在下文中一共展示了CatalogCategoryView::getMsrpListProductBlock方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAssert
/**
* Assert product MAP related data on category page.
*
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param InjectableFixture $product
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, InjectableFixture $product)
{
/** @var CatalogProductSimple $product */
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
$productBlock = $catalogCategoryView->getMsrpListProductBlock()->getProductItem($product);
\PHPUnit_Framework_Assert::assertTrue($productBlock->isVisible(), 'Product is invisible on Category page.');
$priceBlock = $productBlock->getPriceBlock();
\PHPUnit_Framework_Assert::assertEquals($product->getMsrp(), $priceBlock->getOldPrice(), 'Displayed on Category page MAP is incorrect.');
\PHPUnit_Framework_Assert::assertFalse($priceBlock->isRegularPriceVisible(), 'Regular price on Category page is visible and not expected.');
$productBlock->openMapBlock();
$mapBlock = $productBlock->getMapBlock();
\PHPUnit_Framework_Assert::assertEquals($product->getMsrp(), $mapBlock->getOldPrice(), 'Displayed on Category page MAP is incorrect.');
\PHPUnit_Framework_Assert::assertEquals($product->getPrice(), $mapBlock->getActualPrice(), 'Displayed on Category page price is incorrect.');
}