/** * Assert that created CMS block displayed on frontend category page (in order to assign block to category: * go to category page> Display settings> CMS Block). * * @param CmsIndex $cmsIndex * @param CmsBlock $cmsBlock * @param CatalogCategoryView $catalogCategoryView * @param FixtureFactory $fixtureFactory * @return void */ public function processAssert(CmsIndex $cmsIndex, CmsBlock $cmsBlock, CatalogCategoryView $catalogCategoryView, FixtureFactory $fixtureFactory) { $category = $fixtureFactory->createByCode('category', ['dataset' => 'default_subcategory', 'data' => ['display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle()]]); $category->persist(); $cmsIndex->open(); $cmsIndex->getTopmenu()->selectCategoryByName($category->getName()); $categoryViewContent = $catalogCategoryView->getViewBlock()->getContent(); \PHPUnit_Framework_Assert::assertEquals($cmsBlock->getContent(), $categoryViewContent, 'Wrong block content on category is displayed.'); }