Make tests smarts about doctrine presence