You are here

protected function UserProtectWebTestBase::assertUserCanCancel in User protect 7

Asserts that an account's cancel page can be accessed.

Parameters

object $account: The account to cancel.

string $message: (optional) The message to assert.

File

tests/UserProtectWebTestBase.test, line 429
Contains \UserProtectWebTestBase.

Class

UserProtectWebTestBase
Base class for User protect web tests.

Code

protected function assertUserCanCancel($account, $message = NULL) {
  if (!is_null($message)) {
    $message = "The user can be canceled.";
  }

  // Access edit page of protected user.
  $this
    ->drupalGet('user/' . $account->uid . '/cancel');
  $this
    ->assertResponse(200, $message);
}