You are here

public function RestrictByIpUITests::testRoleByIpSettingsSubmit in Restrict Login or Role Access by IP Address 7.3

File

./restrict_by_ip.test, line 460

Class

RestrictByIpUITests
Test admin interfaces. Assumes that local testing environment has IP address of 127.0.0.1.

Code

public function testRoleByIpSettingsSubmit() {

  // Create a role to test.
  $rid = $this
    ->drupalCreateRole(array(
    'access content',
  ));
  $roles = user_roles();
  $rname = $roles[$rid];
  $rname_hashed = _restrict_by_ip_hash_role_name($rname);
  $form = array();
  $form['restrict_by_ip_role_' . $rname_hashed] = '127.0.0.1/32';
  $this
    ->drupalPost('admin/config/people/restrict_by_ip/role', $form, t('Save configuration'));
  $this
    ->assertText('The configuration options have been saved.');
  $this
    ->assertFieldByName('restrict_by_ip_role_' . $rname_hashed, $form['restrict_by_ip_role_' . $rname_hashed]);
}