function SessionConfigurationTest::testEnforcedSessionNameViaCookieDomain

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

Tests whether the session.name ini settings is computed correctly.

@covers ::getOptions

@dataProvider providerTestEnforcedSessionName

File

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

Class

SessionConfigurationTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Session%21SessionConfiguration.php/class/SessionConfiguration/8.9.x" title="Defines the default session configuration generator." class="local">\Drupal\Core\Session\SessionConfiguration</a> @group Session

Namespace

Drupal\Tests\Core\Session

Code

public function testEnforcedSessionNameViaCookieDomain($uri, $expected_name) {
    $config = $this->createSessionConfiguration([
        'cookie_domain' => '.example.com',
    ]);
    $request = Request::create($uri);
    $options = $config->getOptions($request);
    $this->assertEquals($expected_name, $options['name']);
}

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