public function PdoSessionHandlerTest::testReadWriteReadWithNullByte in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\PdoSessionHandlerTest::testReadWriteReadWithNullByte()
File
- vendor/
symfony/ http-foundation/ Tests/ Session/ Storage/ Handler/ PdoSessionHandlerTest.php, line 121
Class
Namespace
Symfony\Component\HttpFoundation\Tests\Session\Storage\HandlerCode
public function testReadWriteReadWithNullByte() {
$sessionData = 'da' . "\0" . 'ta';
$storage = new PdoSessionHandler($this
->getMemorySqlitePdo());
$storage
->open('', 'sid');
$readData = $storage
->read('id');
$storage
->write('id', $sessionData);
$storage
->close();
$this
->assertSame('', $readData, 'New session returns empty string data');
$storage
->open('', 'sid');
$readData = $storage
->read('id');
$storage
->close();
$this
->assertSame($sessionData, $readData, 'Written value can be read back correctly');
}