Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCategoryIncludeInNavigationMenu.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
11 use Magento\Cms\Test\Page\CmsIndex;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
17 class AssertCategoryIncludeInNavigationMenu extends AbstractConstraint
18 {
27  public function processAssert(
28  Category $category,
29  CatalogCategoryView $catalogCategoryView,
30  CmsIndex $cmsIndex
31  ) {
32  $cmsIndex->open();
33  \PHPUnit\Framework\Assert::assertTrue(
34  $catalogCategoryView->getTopmenu()->isCategoryVisible($category->getName()),
35  'Expected that ' . $category->getName() . ' is visible in navigation menu.'
36  );
37  }
38 
44  public function toString()
45  {
46  return "Category is visible in navigation menu";
47  }
48 }
processAssert(Category $category, CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex)