function BootstrapIPAddressTestCase::setUp

Overrides DrupalWebTestCase::setUp

File

modules/simpletest/tests/bootstrap.test, line 20

Class

BootstrapIPAddressTestCase

Code

function setUp() {
    $this->oldserver = $_SERVER;
    $this->remote_ip = '127.0.0.1';
    $this->proxy_ip = '127.0.0.2';
    $this->proxy2_ip = '127.0.0.3';
    $this->forwarded_ip = '127.0.0.4';
    $this->cluster_ip = '127.0.0.5';
    $this->untrusted_ip = '0.0.0.0';
    drupal_static_reset('ip_address');
    $_SERVER['REMOTE_ADDR'] = $this->remote_ip;
    unset($_SERVER['HTTP_X_FORWARDED_FOR']);
    unset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']);
    parent::setUp();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.