See also The main Testing guide describes how to use and set-up a database for your automated tests. The contents of this article show ways to test your Doctrine repositories. Mocking a Doctrine Repository in Unit Tests Unit testing Doctrine repositories is not recommended. Repositories are meant to be tested against a real database connection. However, in case you still need to do this, look at t
![How to Test a Doctrine Repository (Symfony Docs)](https://cdn-ak-scissors.b.st-hatena.com/image/square/b007104dc5bb21837ce4e44ef1bc12ae2175bac1/height=288;version=1;width=512/https%3A%2F%2Fsymfony.com%2Fimages%2Fopengraph%2Fsymfony.png)