You are here

protected function CasPasswordResetTest::assertStatusMessage in CAS 2.x

Asserts that a password reset status message has been displayed.

Parameters

string $username_or_email: The account user name or email.

Throws

\Behat\Mink\Exception\ResponseTextException Thrown when an expectation on the response text fails.

2 calls to CasPasswordResetTest::assertStatusMessage()
CasPasswordResetTest::testPasswordResetAsAnonymous in tests/src/Functional/CasPasswordResetTest.php
Tests password reset form as anonymous.
CasPasswordResetTest::testPasswordResetAsAuthenticated in tests/src/Functional/CasPasswordResetTest.php
Tests password reset form as authenticated user.

File

tests/src/Functional/CasPasswordResetTest.php, line 129

Class

CasPasswordResetTest
Tests the user's ability to reset their password.

Namespace

Drupal\Tests\cas\Functional

Code

protected function assertStatusMessage(string $username_or_email) : void {
  if (Comparator::greaterThanOrEqualTo(\Drupal::VERSION, '9.2')) {
    $message = "If {$username_or_email} is a valid account, an email will be sent with instructions to reset your password.";
  }
  else {

    // @todo Remove when support for Drupal < 9.2.x is dropped.
    $message = 'Further instructions have been sent to your email address.';
  }
  $this
    ->assertSession()
    ->pageTextContains($message);
}