Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomerInvalidEmail.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertCustomerInvalidEmail extends AbstractConstraint
17 {
18  const ERROR_EMAIL_MESSAGE = '"Email" is not a valid hostname.';
19 
27  public function processAssert(CustomerIndexNew $pageCustomerIndexNew)
28  {
29  $expectMessage = self::ERROR_EMAIL_MESSAGE;
30  $actualMessage = $pageCustomerIndexNew->getMessagesBlock()->getErrorMessage();
31 
32  \PHPUnit\Framework\Assert::assertEquals(
33  $expectMessage,
34  $actualMessage,
35  'Wrong success message is displayed.'
36  . "\nExpected: " . $expectMessage
37  . "\nActual: " . $actualMessage
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Assert that error message is displayed.';
49  }
50 }