*/ class MongoDBTest extends TestCase { public function testGetCollection() { $db = $this->getDatabase(); $collection = $db->selectCollection('test'); $this->assertInstanceOf('MongoCollection', $collection); $this->assertSame('mongo-php-adapter.test', (string) $collection); } public function testGetCollectionProperty() { $db = $this->getDatabase(); $collection = $db->test; $this->assertInstanceOf('MongoCollection', $collection); $this->assertSame('mongo-php-adapter.test', (string) $collection); } /** * @return \MongoDB */ protected function getDatabase() { $client = new \MongoClient(); return $client->selectDB('mongo-php-adapter'); } }