function SessionUnitTestCase::testCookieDomain

File

modules/simpletest/tests/session.test, line 856

Class

SessionUnitTestCase
Unit tests for session handling.

Code

function testCookieDomain() {
    $tests = array(
        array(
            'example.com',
            '.example.com',
        ),
        array(
            'www.example.com',
            '.www.example.com',
        ),
        array(
            'subdomain.example.com',
            '.subdomain.example.com',
        ),
    );
    foreach ($tests as $test) {
        $this->assertEqual(_drupal_get_cookie_domain($test[0]), $test[1], 'Correct $cookie_domain for host ' . $test[0]);
    }
}

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