public function testShouldReturnResultsToArray()
{
// Arrange
$collection = m::mock(Collection::class);
$driverCursor = m::mock(IteratorIterator::class);
$cursor = $this->getCursor(null, $collection, 'find', [[]], $driverCursor);
// Act
$driverCursor->shouldReceive('rewind', 'valid', 'key')->andReturn(true, true, false);
$driverCursor->shouldReceive('next')->andReturn(true, false);
$driverCursor->shouldReceive('current')->twice()->andReturn(['name' => 'bob', 'occupation' => 'coder'], ['name' => 'jef', 'occupation' => 'tester']);
$result = $cursor->toArray();
// Assert
$this->assertEquals([['name' => 'bob', 'occupation' => 'coder'], ['name' => 'jef', 'occupation' => 'tester']], $result);
}