Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertUserPasswordChangedSuccessfully.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\User\Test\Page\Adminhtml\UserIndex;
11 
15 class AssertUserPasswordChangedSuccessfully extends AbstractConstraint
16 {
20  const FAIL_MESSAGE = 'Sorry, but this password has already been used. Please create another.';
21 
28  public function processAssert(UserIndex $userIndex)
29  {
30  $errorMessage = $userIndex->getMessagesBlock()->getErrorMessage();
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::FAIL_MESSAGE,
33  $errorMessage,
34  'Password update failed with error: "' . self::FAIL_MESSAGE . '"'
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Password validation completed successfully.';
46  }
47 }