You are here

public function PdoSessionHandlerTest::testWriteDifferentSessionIdThanRead in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler\PdoSessionHandlerTest::testWriteDifferentSessionIdThanRead()

Simulates session_regenerate_id(true) which will require an INSERT or UPDATE (replace).

File

vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php, line 210

Class

PdoSessionHandlerTest

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler

Code

public function testWriteDifferentSessionIdThanRead() {
  $storage = new PdoSessionHandler($this
    ->getMemorySqlitePdo());
  $storage
    ->open('', 'sid');
  $storage
    ->read('id');
  $storage
    ->destroy('id');
  $storage
    ->write('new_id', 'data_of_new_session_id');
  $storage
    ->close();
  $storage
    ->open('', 'sid');
  $data = $storage
    ->read('new_id');
  $storage
    ->close();
  $this
    ->assertSame('data_of_new_session_id', $data, 'Data of regenerated session id is available');
}