Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
Cms
Test
Constraint
AssertCmsBlockNotOnCategoryPage.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Cms\Test\Constraint
;
8
9
use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
10
use
Magento\Cms\Test\Fixture\CmsBlock
;
11
use Magento\Cms\Test\Page\CmsIndex;
12
use Magento\Mtf\Constraint\AbstractConstraint;
13
use Magento\Mtf\Fixture\FixtureFactory;
14
use
Magento\Catalog\Test\Fixture\Category
;
15
19
class
AssertCmsBlockNotOnCategoryPage
extends
AbstractConstraint
20
{
32
public
function
processAssert
(
33
CmsIndex $cmsIndex,
34
CmsBlock
$cmsBlock,
35
CatalogCategoryView $catalogCategoryView,
36
FixtureFactory $fixtureFactory,
37
Category
$category
=
null
38
) {
39
if
(
$category
===
null
) {
40
$category
= $fixtureFactory->createByCode(
41
'category'
,
42
[
43
'dataset'
=>
'default_subcategory'
,
44
'data'
=> [
45
'display_mode'
=>
'Static block and products'
,
46
'landing_page'
=> $cmsBlock->getTitle(),
47
]
48
]
49
);
50
$category
->persist();
51
}
52
53
$cmsIndex->open();
54
$cmsIndex->getTopmenu()->selectCategoryByName(
$category
->getName());
55
$categoryViewContent = $catalogCategoryView->getViewBlock()->getContent();
56
57
\PHPUnit\Framework\Assert::assertNotEquals(
58
$cmsBlock->getContent(),
59
$categoryViewContent,
60
'Wrong block content on category is displayed.'
61
);
62
}
63
69
public
function
toString
()
70
{
71
return
'CMS block description is absent on Category page (frontend).'
;
72
}
73
}
$category
$category
Definition:
catalog_category_with_slash.php:7
Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage
Definition:
AssertCmsBlockNotOnCategoryPage.php:19
Magento\Cms\Test\Fixture\CmsBlock
Definition:
Stores.php:7
Magento\Cms\Test\Constraint
Definition:
AssertAuthorizationLinkIsVisibleOnStoreFront.php:7
Magento\Catalog\Test\Fixture\Category
Definition:
CategoryProducts.php:7
Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage\toString
toString()
Definition:
AssertCmsBlockNotOnCategoryPage.php:69
Magento\Cms\Model\Block
Definition:
DataProvider.php:6
Magento\Cms\Test\Constraint\AssertCmsBlockNotOnCategoryPage\processAssert
processAssert(CmsIndex $cmsIndex, CmsBlock $cmsBlock, CatalogCategoryView $catalogCategoryView, FixtureFactory $fixtureFactory, Category $category=null)
Definition:
AssertCmsBlockNotOnCategoryPage.php:32