You are here

public function UiTest::testAdminAddUserValidation in Restrict Login or Role Access by IP Address 8.4

File

src/Tests/UiTest.php, line 80

Class

UiTest
Test admin interfaces.

Namespace

Drupal\restrict_by_ip\Tests

Code

public function testAdminAddUserValidation() {
  $user = $this
    ->drupalCreateUser();
  $form = [];
  $form['name'] = $user
    ->label() . ' (' . $user
    ->id() . ')';
  $form['restriction'] = 'not_an_ip';
  $this
    ->drupalPostForm('admin/config/people/restrict_by_ip/login/user', $form, t('Save configuration'));
  $this
    ->assertText('IP address must be in CIDR notation.');
}