function SessionConfigurationTest::testConstructorDefaultSettings

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php \Drupal\Tests\Core\Session\SessionConfigurationTest::testConstructorDefaultSettings()
  2. 10 core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php \Drupal\Tests\Core\Session\SessionConfigurationTest::testConstructorDefaultSettings()

Tests constructor's default settings.

@covers ::__construct

File

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

Class

SessionConfigurationTest
@coversDefaultClass \Drupal\Core\Session\SessionConfiguration @group Session

Namespace

Drupal\Tests\Core\Session

Code

public function testConstructorDefaultSettings() : void {
    $config = $this->createSessionConfiguration([]);
    $options = $config->getOptions(Request::createFromGlobals());
    $this->assertSame('', $options['name_suffix']);
    $config = $this->createSessionConfiguration([
        'name_suffix' => 'some-suffix',
    ]);
    $options = $config->getOptions(Request::createFromGlobals());
    $this->assertSame('some-suffix', $options['name_suffix']);
}

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