Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertWrongPassConfirmationMessage.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Test\Page\CustomerAccountEdit;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertWrongPassConfirmationMessage extends AbstractConstraint
17 {
18  /* tags */
19  const SEVERITY = 'low';
20  /* end tags */
21 
25  const CONFIRMATION_MESSAGE = 'Please enter the same value again.';
26 
34  public function processAssert(Customer $customer, CustomerAccountEdit $customerAccountEdit)
35  {
36  $validationMessages = $customerAccountEdit->getAccountInfoForm()->getValidationMessages($customer);
37  if (isset($validationMessages['password_confirmation'])) {
38  \PHPUnit\Framework\Assert::assertEquals(
39  self::CONFIRMATION_MESSAGE,
40  $validationMessages['password_confirmation'],
41  'Wrong password confirmation validation text message.'
42  );
43  } else {
44  \PHPUnit\Framework\TestCase::fail('Password confirmation validation message is absent.');
45  }
46  }
47 
53  public function toString()
54  {
55  return 'Password confirmation validation text message is displayed.';
56  }
57 }
processAssert(Customer $customer, CustomerAccountEdit $customerAccountEdit)
$customer
Definition: customers.php:11