Better mocking method of doctrine
Replace equal by same
Refactoring of RepositoryTest