public function testErrorOnParseException()
{
$file = m::mock('\\Psecio\\Parse\\File');
$file->shouldReceive('isPathMatch')->once()->with('/\\.phps$/i')->andReturn(true);
$file->shouldReceive('getContents')->once()->andReturn('');
$dispatcher = $this->createErrorDispatcherMock();
$scanner = new Scanner($dispatcher, m::mock('\\Psecio\\Parse\\CallbackVisitor')->shouldReceive('onNodeFailure', 'setFile')->mock(), m::mock('\\PhpParser\\Parser')->shouldReceive('parse')->andThrow(new \PhpParser\Error(''))->mock(), m::mock('\\PhpParser\\NodeTraverser')->shouldReceive('addVisitor')->shouldReceive('traverse')->mock());
$scanner->scan(m::mock('\\Psecio\\Parse\\FileIterator')->shouldReceive('getIterator')->andReturn(new \ArrayIterator([$file]))->mock());
}