| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Alcaeus\MongoDbAdapter\Tests;
- /**
- * @author alcaeus <alcaeus@alcaeus.org>
- * @covers MongoDB
- */
- 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');
- }
- }
|