You are here

public function PdoSessionHandlerTest::testWrongUsageStillWorks 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::testWrongUsageStillWorks()

File

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

Class

PdoSessionHandlerTest

Namespace

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

Code

public function testWrongUsageStillWorks() {

  // wrong method sequence that should no happen, but still works
  $storage = new PdoSessionHandler($this
    ->getMemorySqlitePdo());
  $storage
    ->write('id', 'data');
  $storage
    ->write('other_id', 'other_data');
  $storage
    ->destroy('inexistent');
  $storage
    ->open('', 'sid');
  $data = $storage
    ->read('id');
  $otherData = $storage
    ->read('other_id');
  $storage
    ->close();
  $this
    ->assertSame('data', $data);
  $this
    ->assertSame('other_data', $otherData);
}