public function RestrictByIpUITests::testRoleByIpSettingsValidation in Restrict Login or Role Access by IP Address 7.3
File
- ./
restrict_by_ip.test, line 446
Class
- RestrictByIpUITests
- Test admin interfaces. Assumes that local testing environment has IP address of 127.0.0.1.
Code
public function testRoleByIpSettingsValidation() {
// 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] = 'not_an_ip';
$this
->drupalPost('admin/config/people/restrict_by_ip/role', $form, t('Save configuration'));
$this
->assertText('IP Address in Incorrect Format.');
}