function BootstrapTrustedHostsTestCase::providerTestTrustedHosts

Provides test data for testTrustedHosts().

1 call to BootstrapTrustedHostsTestCase::providerTestTrustedHosts()
BootstrapTrustedHostsTestCase::testTrustedHosts in modules/simpletest/tests/bootstrap.test
Tests hostname validation.

File

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

Class

BootstrapTrustedHostsTestCase
Test the trusted HTTP host configuration.

Code

public function providerTestTrustedHosts() {
    $data = array();
    // Tests canonical URL.
    $data[] = array(
        'www.example.com',
        'canonical URL is trusted',
        TRUE,
    );
    // Tests missing hostname for HTTP/1.0 compatability where the Host
    // header is optional.
    $data[] = array(
        NULL,
        'empty Host is valid',
        TRUE,
    );
    // Tests the additional patterns from the settings.
    $data[] = array(
        'example.com',
        'host from settings is trusted',
        TRUE,
    );
    $data[] = array(
        'subdomain.example.com',
        'host from settings is trusted',
        TRUE,
    );
    $data[] = array(
        'www.example.org',
        'host from settings is trusted',
        TRUE,
    );
    $data[] = array(
        'example.org',
        'host from settings is trusted',
        TRUE,
    );
    // Tests mismatch.
    $data[] = array(
        'www.blackhat.com',
        'unspecified host is untrusted',
        FALSE,
    );
    return $data;
}

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