Explorar el Código

Add test to ensure MongoCommandCursor implements MongoCursorInterface

Andreas Braun hace 6 años
padre
commit
1bfccc6aa9
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      tests/Alcaeus/MongoDbAdapter/Mongo/MongoCommandCursorTest.php

+ 9 - 0
tests/Alcaeus/MongoDbAdapter/Mongo/MongoCommandCursorTest.php

@@ -2,6 +2,7 @@
 
 namespace Alcaeus\MongoDbAdapter\Tests\Mongo;
 
+use MongoCursorInterface;
 use MongoDB\Database;
 use MongoDB\Driver\ReadPreference;
 use Alcaeus\MongoDbAdapter\Tests\TestCase;
@@ -202,4 +203,12 @@ class MongoCommandCursorTest extends TestCase
             ],
         ];
     }
+
+    public function testInterfaces()
+    {
+        $this->prepareData();
+        $cursor = $this->getCollection()->aggregateCursor([['$match' => ['foo' => 'bar']]]);
+
+        $this->assertInstanceOf(MongoCursorInterface::class, $cursor);
+    }
 }