You are here

public function RestrictByIpRoleTests::testUIRoleRenamed in Restrict Login or Role Access by IP Address 7.3

File

./restrict_by_ip.test, line 204

Class

RestrictByIpRoleTests
Test that role restrictions work. Assumes that local testing environment has IP address of 127.0.0.1.

Code

public function testUIRoleRenamed() {
  variable_set('restrict_by_ip_role_' . _restrict_by_ip_hash_role_name($this->role['name']), '127.0.0.0/8');
  $this
    ->drupalLogin($this->regularUser);
  $form = array();
  $form['name'] = 'a new role name';
  $this
    ->drupalPost('admin/people/permissions/roles/edit/' . $this->role['id'], $form, t('Save role'));
  $this
    ->assertText('The role has been renamed.');
  $ip = variable_get('restrict_by_ip_role_' . _restrict_by_ip_hash_role_name('a new role name'), '');
  $this
    ->assertEqual($ip, '127.0.0.0/8', 'IP restriction updated');
}