You are here

public function RestrictByIpLoginTests::testUserDelete in Restrict Login or Role Access by IP Address 7.3

File

./restrict_by_ip.test, line 121

Class

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

Code

public function testUserDelete() {
  db_query("INSERT INTO {restrict_by_ip} (uid, restrict_by_ip_address) VALUES (:uid, :ip)", array(
    ':uid' => $this->regularUser->uid,
    ':ip' => '10.0.0.0/8',
  ));
  user_delete($this->regularUser->uid);
  $result = db_query("SELECT restrict_by_ip_address FROM {restrict_by_ip} WHERE uid = :uid", array(
    ':uid' => $this->regularUser->uid,
  ));
  $this
    ->assertEqual($result
    ->rowCount(), 0);
}