本文整理汇总了PHP中Magento\Catalog\Test\Page\Category\CatalogCategoryView::getLayeredNavigationBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogCategoryView::getLayeredNavigationBlock方法的具体用法?PHP CatalogCategoryView::getLayeredNavigationBlock怎么用?PHP CatalogCategoryView::getLayeredNavigationBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Test\Page\Category\CatalogCategoryView
的用法示例。
在下文中一共展示了CatalogCategoryView::getLayeredNavigationBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Check whether the attribute filter is displayed on the frontend in Layered navigation.
*
* @param CatalogCategoryView $catalogCategoryView
* @param InjectableFixture $product
* @param CatalogProductAttribute $attribute
* @param CmsIndex $cmsIndex
* @param FixtureFactory $fixtureFactory
* @return void
*/
public function processAssert(CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute, CmsIndex $cmsIndex, FixtureFactory $fixtureFactory)
{
$fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor', 'data' => ['category_ids' => ['presets' => null, 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0]]]])->persist();
$cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
$label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
\PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), 'Attribute is absent in layered navigation on category page.');
}
示例2: processAssert
/**
* Assertion that filtered product list via layered navigation are displayed correctly.
*
* @param Category $category
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param array $layeredNavigation
* @return void
*/
public function processAssert(Category $category, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, array $layeredNavigation)
{
$this->products = $category->getDataFieldConfig('category_products')['source']->getProducts();
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategoryByName($category->getName());
foreach ($layeredNavigation as $filters) {
foreach ($filters as $filter) {
$catalogCategoryView->getLayeredNavigationBlock()->applyFilter($filter['title'], $filter['linkPattern']);
$productNames = $this->getProductNames($filter['products']);
sort($productNames);
$pageProductNames = $catalogCategoryView->getListProductBlock()->getProductNames();
sort($pageProductNames);
\PHPUnit_Framework_Assert::assertEquals($productNames, $pageProductNames);
}
$catalogCategoryView->getLayeredNavigationBlock()->clearAll();
}
}
示例3: processAssert
/**
* Check out if the attribute in the navigation bar on the search results page in Layered navigation.
*
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param InjectableFixture $product
* @param CatalogProductAttribute $attribute
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute)
{
$cmsIndex->open()->getSearchBlock()->search($product->getName());
$label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
\PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), 'Attribute is absent in layered navigation on search page.');
}