本文整理汇总了PHP中Magento\Catalog\Test\Page\Category\CatalogCategoryView::getWidgetView方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogCategoryView::getWidgetView方法的具体用法?PHP CatalogCategoryView::getWidgetView怎么用?PHP CatalogCategoryView::getWidgetView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Test\Page\Category\CatalogCategoryView
的用法示例。
在下文中一共展示了CatalogCategoryView::getWidgetView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Assert that created widget displayed on frontent in Catalog.
*
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param Widget $widget
* @param AdminCache $adminCache
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, Widget $widget, AdminCache $adminCache)
{
// Flush cache
$adminCache->open();
$adminCache->getActionsBlock()->flushMagentoCache();
$adminCache->getMessagesBlock()->waitSuccessMessage();
$cmsIndex->open();
if (isset($widget->getWidgetInstance()[0]['entities'])) {
$categoryName = $widget->getWidgetInstance()[0]['entities']->getName();
} else {
$categoryName = $widget->getParameters()['entities']->getCategoyId()[0];
}
if ($widget->getCode() == 'CMS Static Block') {
$widgetText = $widget->getParameters()['entities'][0]->getContent();
} else {
$widgetText = $widget->getParameters()['anchor_text'];
}
$cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
\PHPUnit_Framework_Assert::assertTrue($catalogCategoryView->getWidgetView()->isWidgetVisible($widget, $widgetText), 'Widget is absent on Category page.');
}