Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
AssertEmailErrorValidationMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutOnepage;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertEmailErrorValidationMessage extends AbstractConstraint
16 {
20  const EMAIL_VALIDATION_MESSAGE = 'Please enter a valid email address (Ex: johndoe@domain.com).';
21 
28  public function processAssert(
29  CheckoutOnepage $checkoutOnepage
30  ) {
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::EMAIL_VALIDATION_MESSAGE,
33  $checkoutOnepage->getShippingBlock()->getEmailError(),
34  'Email validation message is not correct.'
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Email validation message is correct.';
46  }
47 }