You are here

public function RoleTest::testUIRoleRenamed in Restrict Login or Role Access by IP Address 8.4

File

src/Tests/RoleTest.php, line 54

Class

RoleTest
Tests roles are restricted to certain IP address range(s).

Namespace

Drupal\restrict_by_ip\Tests

Code

public function testUIRoleRenamed() {
  $this->conf
    ->set('role.' . $this->role
    ->id(), $this->currentIPCIDR)
    ->save();
  $this
    ->drupalLogin($this->regularUser);
  $edit = [];
  $edit['label'] = 'a new role name';
  $this
    ->drupalPostForm('admin/people/roles/manage/' . $this->role
    ->id(), $edit, t('Save'));
  $this
    ->assertText('Role a new role name has been updated.');
  $updatedConf = $this
    ->config('restrict_by_ip.settings');
  $ip = $updatedConf
    ->get('role.' . $this->role
    ->id());
  $this
    ->assertEqual($ip, $this->currentIPCIDR, 'IP restriction updated');
}