public function MongoDbSessionHandlerTest::testReplaceSessionData

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php, line 68

Class

MongoDbSessionHandlerTest
@author Markus Bachmann <markus.bachmann@bachi.biz>

Namespace

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

Code

public function testReplaceSessionData() {
  $this->storage
    ->write('foo', 'bar');
  $this->storage
    ->write('foo', 'foobar');
  $coll = self::$mongo
    ->selectDB($this->options['database'])
    ->selectCollection($this->options['collection']);
  $this
    ->assertEquals('foobar', $this->storage
    ->read('foo'));
  $this
    ->assertEquals(1, $coll
    ->find(array(
    'sess_id' => 'foo',
  ))
    ->count());
}