You are here

public function SessionConfigurationTest::testEnforcedSessionNameViaCookieDomain in Drupal 8

Same name and namespace in other branches
  1. 9 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 \Drupal\Core\Session\SessionConfiguration @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']);
}