function SessionConfigurationTest::providerTestEnforcedCookieDomain

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php \Drupal\Tests\Core\Session\SessionConfigurationTest::providerTestEnforcedCookieDomain()
  2. 10 core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php \Drupal\Tests\Core\Session\SessionConfigurationTest::providerTestEnforcedCookieDomain()
  3. 9 core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php \Drupal\Tests\Core\Session\SessionConfigurationTest::providerTestEnforcedCookieDomain()
  4. 8.9.x core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php \Drupal\Tests\Core\Session\SessionConfigurationTest::providerTestEnforcedCookieDomain()

Data provider for the cookie domain test.

Return value

array Test data

File

core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php, line 94

Class

SessionConfigurationTest
Tests Drupal\Core\Session\SessionConfiguration.

Namespace

Drupal\Tests\Core\Session

Code

public static function providerTestEnforcedCookieDomain() : array {
  return [
    [
      'http://example.com/path/index.php',
      '.example.com',
    ],
    [
      'http://www.example.com/path/index.php',
      '.example.com',
    ],
    [
      'http://subdomain.example.com/path/index.php',
      '.example.com',
    ],
    [
      'http://example.com:8080/path/index.php',
      '.example.com',
    ],
    [
      'https://example.com/path/index.php',
      '.example.com',
    ],
    [
      'http://localhost/path/index.php',
      '.example.com',
    ],
    [
      'http://127.0.0.1/path/index.php',
      '.example.com',
    ],
    [
      'http://127.0.0.1:8888/path/index.php',
      '.example.com',
    ],
    [
      'http://1.1.1.1/path/index.php',
      '.example.com',
    ],
    [
      'http://[::1]/path/index.php',
      '.example.com',
    ],
    [
      'http://[::1]:8888/path/index.php',
      '.example.com',
    ],
  ];
}

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