public function testSetMongoRegex() { $doc = $this->collection->createDocument(array('code' => new \MongoRegex('/[a-z]/')))->save(); $this->assertInstanceOf('\\MongoRegex', $this->collection->getDocumentDirectly($doc->getId())->code); }