public function testGetCollection() { $m = new MongoClient(); Connection::setMongoClient($m); $collection = Connection::getCollection('test'); $this->assertInstanceOf("MongoCollection", $collection); $this->assertEquals('test', $collection->getName()); }
public function setup() { $m = new MongoClient(); $m->dropDB('test'); Connection::setMongoClient($m); Connection::setDefaultDatabaseName('test'); for ($c = 0; $c < 5; $c++) { $data = ["test{$c}" => "{$c}", "_id" => new MongoId(), "_class" => 'Hydrant\\Document']; $this->records[] = $data; $m->test->default->insert($data); } $this->cursor = $m->test->default->find(); }
public function setUp() { $m = new MongoClient(); Connection::setMongoClient($m); Connection::setDefaultDatabaseName('test'); }