Andreas Braun 10 лет назад
Родитель
Сommit
7dccfc30ea

+ 0 - 1
tests/Alcaeus/MongoDbAdapter/MongoClientTest.php

@@ -4,7 +4,6 @@ namespace Alcaeus\MongoDbAdapter\Tests;
 
 /**
  * @author alcaeus <alcaeus@alcaeus.org>
- * @covers MongoClient
  */
 class MongoClientTest extends TestCase
 {

+ 26 - 1
tests/Alcaeus/MongoDbAdapter/MongoCollectionTest.php

@@ -4,10 +4,15 @@ namespace Alcaeus\MongoDbAdapter\Tests;
 
 /**
  * @author alcaeus <alcaeus@alcaeus.org>
- * @covers MongoCollection
  */
 class MongoCollectionTest extends TestCase
 {
+    public function testGetNestedCollections()
+    {
+        $collection = $this->getCollection()->foo->bar;
+        $this->assertSame('mongo-php-adapter.test.foo.bar', (string) $collection);
+    }
+
     public function testCreateRecord()
     {
         $id = '54203e08d51d4a1f868b456e';
@@ -26,6 +31,26 @@ class MongoCollectionTest extends TestCase
         $this->assertAttributeSame('bar', 'foo', $object);
     }
 
+    public function testFindReturnsCursor()
+    {
+        $collection = $this->getCollection();
+
+        $collection->insert(['sorter' => 1]);
+
+        $this->assertInstanceOf('MongoCursor', $collection->find());
+    }
+
+    public function testCount()
+    {
+        $collection = $this->getCollection();
+
+        $collection->insert(['foo' => 'bar']);
+        $collection->insert(['foo' => 'foo']);
+
+        $this->assertSame(2, $collection->count());
+        $this->assertSame(1, $collection->count(['foo' => 'bar']));
+    }
+
     /**
      * @return \MongoCollection
      */

+ 0 - 1
tests/Alcaeus/MongoDbAdapter/MongoDBTest.php

@@ -4,7 +4,6 @@ namespace Alcaeus\MongoDbAdapter\Tests;
 
 /**
  * @author alcaeus <alcaeus@alcaeus.org>
- * @covers MongoDB
  */
 class MongoDBTest extends TestCase
 {

+ 0 - 1
tests/Alcaeus/MongoDbAdapter/MongoIdTest.php

@@ -4,7 +4,6 @@ namespace Alcaeus\MongoDbAdapter\Tests;
 
 /**
  * @author alcaeus <alcaeus@alcaeus.org>
- * @covers MongoId
  */
 class MongoIdTest extends TestCase
 {