public function WriteSafeSessionHandlerTest::testConstructWriteSafeSessionHandlerDisableWriting in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 78 - Contains \Drupal\Tests\Core\Session\WriteSafeSessionHandlerTest.
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
->assertSame($this->sessionHandler
->isSessionWritable(), FALSE);
$result = $this->sessionHandler
->write($session_id, $session_data);
$this
->assertSame($result, TRUE);
}