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
User
Test
Constraint
AssertUserInvalidEmailHostnameMessage.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\User\Test\Constraint
;
8
9
use
Magento\User\Test\Fixture\User
;
10
use Magento\User\Test\Page\Adminhtml\UserEdit;
11
use Magento\Mtf\Constraint\AbstractConstraint;
12
16
class
AssertUserInvalidEmailHostnameMessage
extends
AbstractConstraint
17
{
18
/* tags */
19
const
SEVERITY
=
'low'
;
20
/* end tags */
21
22
const
ERROR_MESSAGE
=
'\'
%s\
' is not a valid hostname for email address \'%s\''
;
23
31
public
function
processAssert
(UserEdit $userEdit, User
$user
)
32
{
33
$email
=
$user
->getEmail();
34
$hostname = substr(
$email
, strpos(
$email
,
'@'
)+1);
35
$expectedMessage = sprintf(self::ERROR_MESSAGE, $hostname,
$email
);
36
$actualMessage = $userEdit->getMessagesBlock()->getErrorMessage();
37
\PHPUnit\Framework\Assert::assertEquals(
38
$expectedMessage,
39
$actualMessage,
40
'Wrong error message is displayed.'
41
.
"\nExpected: "
. $expectedMessage
42
.
"\nActual: "
. $actualMessage
43
);
44
}
45
51
public
function
toString
()
52
{
53
return
'Error message about invalid hostname for email on creation user page is correct.'
;
54
}
55
}
$email
$email
Definition:
details.phtml:13
Magento\User\Test\Constraint\AssertUserInvalidEmailHostnameMessage\toString
toString()
Definition:
AssertUserInvalidEmailHostnameMessage.php:51
Magento\User\Test\Constraint\AssertUserInvalidEmailHostnameMessage\SEVERITY
const SEVERITY
Definition:
AssertUserInvalidEmailHostnameMessage.php:19
$user
$user
Definition:
dummy_user.php:13
Magento\User\Test\Constraint\AssertUserInvalidEmailHostnameMessage\processAssert
processAssert(UserEdit $userEdit, User $user)
Definition:
AssertUserInvalidEmailHostnameMessage.php:31
Magento\User\Test\Constraint\AssertUserInvalidEmailHostnameMessage
Definition:
AssertUserInvalidEmailHostnameMessage.php:16
Magento\User\Test\Constraint
Definition:
AssertAccessTokensErrorRevokeMessage.php:7
Magento\User\Test\Fixture\User
Definition:
CurrentPassword.php:7
Magento\User\Test\Constraint\AssertUserInvalidEmailHostnameMessage\ERROR_MESSAGE
const ERROR_MESSAGE
Definition:
AssertUserInvalidEmailHostnameMessage.php:22