public function MongoDbSessionHandlerTest::testGc

File

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

Class

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

Namespace

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

Code

public function testGc() {
  $this->storage
    ->write('foo', 'bar');
  $this->storage
    ->write('bar', 'foo');
  $coll = self::$mongo
    ->selectDB($this->options['database'])
    ->selectCollection($this->options['collection']);
  $this
    ->assertEquals(2, $coll
    ->count());
  $this->storage
    ->gc(-1);
  $this
    ->assertEquals(0, $coll
    ->count());
}