function WriteSafeSessionHandlerTest::testConstructWriteSafeSessionHandlerDisableWriting
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php \Drupal\Tests\Core\Session\WriteSafeSessionHandlerTest::testConstructWriteSafeSessionHandlerDisableWriting()
- 10 core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php \Drupal\Tests\Core\Session\WriteSafeSessionHandlerTest::testConstructWriteSafeSessionHandlerDisableWriting()
- 11.x core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php \Drupal\Tests\Core\Session\WriteSafeSessionHandlerTest::testConstructWriteSafeSessionHandlerDisableWriting()
Tests creating a WriteSafeSessionHandler with session writing disabled.
@covers ::__construct @covers ::isSessionWritable @covers ::write
File
-
core/
tests/ Drupal/ Tests/ Core/ Session/ WriteSafeSessionHandlerTest.php, line 71
Class
Namespace
Drupal\Tests\Core\SessionCode
public function testConstructWriteSafeSessionHandlerDisableWriting() {
$session_id = 'some-id';
$session_data = 'serialized-session-data';
// Disable writing upon construction.
$this->sessionHandler = new WriteSafeSessionHandler($this->wrappedSessionHandler, FALSE);
$this->assertFalse($this->sessionHandler
->isSessionWritable());
$result = $this->sessionHandler
->write($session_id, $session_data);
$this->assertTrue($result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.