You are here

public function LoginTest::testIpMatchGlobalMatchUser in Restrict Login or Role Access by IP Address 8.4

File

src/Tests/LoginTest.php, line 73

Class

LoginTest
Tests logins are restricted to certain IP address range(s).

Namespace

Drupal\restrict_by_ip\Tests

Code

public function testIpMatchGlobalMatchUser() {

  // Add out of range global IP.
  $this->conf
    ->set('login_range', $this->currentIPCIDR);

  // Add in range user IP.
  $this->conf
    ->set('user.' . $this->regularUser
    ->id(), $this->currentIPCIDR);
  $this->conf
    ->save();
  $this
    ->drupalLogin($this->regularUser);
}