createEmbeddedCursor() public method

Creates a new instance of EmbeddedCursor.
public createEmbeddedCursor ( string $entityClass, array $items ) : Mongolid\Cursor\CursorInterface
$entityClass string Class of the objects that will be retrieved by the cursor.
$items array The items array.
return Mongolid\Cursor\CursorInterface
 public function testShouldCreateAEmbeddedCursor()
 {
     // Set
     $factory = new CursorFactory();
     $entityClass = 'MyModelClass';
     // Assert
     $result = $factory->createEmbeddedCursor($entityClass, [['foo' => 'bar']]);
     $this->assertInstanceOf(EmbeddedCursor::class, $result);
     $this->assertNotInstanceOf(Cursor::class, $result);
     $this->assertNotInstanceOf(CacheableCursor::class, $result);
     $this->assertAttributeEquals($entityClass, 'entityClass', $result);
     $this->assertAttributeEquals([['foo' => 'bar']], 'items', $result);
 }