Fixed the testing of Doctrine versions

This ensures that other packages used by the ORM are also used at the
same version, especially for dev ones needing to be whitelisted.