/**
* @dataProvider provideQueryTypesThatDoReturnAnIterator
* @expectedException UnexpectedValueException
*/
public function testGetIteratorShouldThrowExceptionAfterExecutingForTypesThatShouldReturnAnIteratorButDoNot($type, $method)
{
$collection = $this->getMockCollection();
$collection->expects($this->once())->method($method)->will($this->returnValue(null));
// Create a query array with any fields that may be expected to exist
$queryArray = array('type' => $type, 'query' => array(), 'group' => array('keys' => array(), 'initial' => array(), 'reduce' => '', 'options' => array()), 'mapReduce' => array('map' => '', 'reduce' => '', 'out' => '', 'options' => array()), 'geoNear' => array('near' => array(), 'options' => array()), 'distinct' => 0);
$query = new Query($collection, $queryArray, array());
$query->getIterator();
}