MessageManagerMessageIterator unit tests & fix optimize on doctrine command