Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSubCategoryNotInNavigationMenu.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 AssertSubCategoryNotInNavigationMenu extends AbstractConstraint
18 {
27  public function processAssert(
28  Category $subcategory,
29  CatalogCategoryView $catalogCategoryView,
30  CmsIndex $cmsIndex
31  ) {
32  $cmsIndex->open();
33  \PHPUnit\Framework\Assert::assertFalse(
34  $catalogCategoryView->getTopmenu()->isCategoryVisible($subcategory->getName()),
35  'Expected that ' . $subcategory->getName() . ' is not visible in navigation menu.'
36  );
37  }
38 
44  public function toString()
45  {
46  return "Subcategory is not visible in navigation menu";
47  }
48 }
processAssert(Category $subcategory, CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex)