public function testGc() {
$collection = $this
->getMockBuilder('MongoCollection')
->disableOriginalConstructor()
->getMock();
$this->mongo
->expects($this
->once())
->method('selectCollection')
->with($this->options['database'], $this->options['collection'])
->will($this
->returnValue($collection));
$that = $this;
$collection
->expects($this
->once())
->method('remove')
->will($this
->returnCallback(function ($criteria) use ($that) {
$that
->assertInstanceOf('MongoDate', $criteria[$that->options['time_field']]['$lt']);
$that
->assertGreaterThanOrEqual(time() - -1, $criteria[$that->options['time_field']]['$lt']->sec);
}));
$this
->assertTrue($this->storage
->gc(-1));
}