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
AssertCmsPageDuplicateErrorMessage.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Cms\Test\Constraint
;
8
9
use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex;
10
use Magento\Mtf\Constraint\AbstractConstraint;
11
use
Magento\Cms\Test\Fixture\CmsPage
;
12
16
class
AssertCmsPageDuplicateErrorMessage
extends
AbstractConstraint
17
{
21
const
ERROR_MESSAGE_TITLE
=
'The value specified in the URL Key field would generate a URL that already exists.'
;
22
30
public
function
processAssert
(CmsPageIndex $cmsIndex,
CmsPage
$cmsPage)
31
{
32
$actualMessage = $cmsIndex->getMessagesBlock()->getErrorMessage();
33
34
\PHPUnit\Framework\Assert::assertContains(
35
self::ERROR_MESSAGE_TITLE,
36
$actualMessage,
37
'Wrong error message is displayed.'
38
.
"\nExpected: "
. self::ERROR_MESSAGE_TITLE
39
.
"\nActual:\n"
. $actualMessage
40
);
41
42
\PHPUnit\Framework\Assert::assertContains(
43
$cmsPage->getIdentifier(),
44
$actualMessage,
45
'CMS page url is not present on error message.'
46
.
"\nExpected: "
. self::ERROR_MESSAGE_TITLE
47
.
"\nActual:\n"
. $actualMessage
48
);
49
}
50
56
public
function
toString
()
57
{
58
return
'Assert that page with duplicated identifier has not been created.'
;
59
}
60
}
Magento\Cms\Test\Constraint\AssertCmsPageDuplicateErrorMessage\processAssert
processAssert(CmsPageIndex $cmsIndex, CmsPage $cmsPage)
Definition:
AssertCmsPageDuplicateErrorMessage.php:30
Magento\Cms\Test\Constraint\AssertCmsPageDuplicateErrorMessage\toString
toString()
Definition:
AssertCmsPageDuplicateErrorMessage.php:56
Magento\Cms\Test\Constraint
Definition:
AssertAuthorizationLinkIsVisibleOnStoreFront.php:7
Magento\Cms\Test\Constraint\AssertCmsPageDuplicateErrorMessage\ERROR_MESSAGE_TITLE
const ERROR_MESSAGE_TITLE
Definition:
AssertCmsPageDuplicateErrorMessage.php:21
Magento\Cms\Test\Constraint\AssertCmsPageDuplicateErrorMessage
Definition:
AssertCmsPageDuplicateErrorMessage.php:16
Magento\Cms\Model\Page
Definition:
DataProvider.php:6
Magento\Cms\Test\Fixture\CmsPage
Definition:
Content.php:7