You are here

public function UserProtectionTest::testMailProtection in User protect 8

Tests if the user's mail address field has the expected protection.

File

tests/src/Functional/UserProtectionTest.php, line 43

Class

UserProtectionTest
Tests each UserProtection plugin in action.

Namespace

Drupal\Tests\userprotect\Functional

Code

public function testMailProtection() {
  $protected_account = $this
    ->createProtectedUser([
    'user_mail',
  ]);
  $this
    ->drupalGet('user/' . $protected_account
    ->id() . '/edit');
  $this
    ->assertSession()
    ->fieldDisabled('mail');
}