Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertPasswordLengthErrorMessage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Page\CustomerAccountCreate;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertPasswordLengthErrorMessage extends AbstractConstraint
16 {
17  const PASSWORD_LENGTH_ERROR_MESSAGE = 'Minimum length of this field must be equal or greater than 8 symbols';
18 
26  public function processAssert(CustomerAccountCreate $registerPage)
27  {
28  $errorMessage = $registerPage->getRegisterForm()->getPasswordError();
29  \PHPUnit\Framework\Assert::assertContains(
30  self::PASSWORD_LENGTH_ERROR_MESSAGE,
31  $errorMessage,
32  'Incorrect password error message.'
33  );
34  }
35 
41  public function toString()
42  {
43  return 'Password too short message is present on customer registration page.';
44  }
45 }