Could someone explain me how can I add some entities in to database for test purpose? I want to test that endpoint /show/{id} show correct response, but to check that i need to have a entity in test database so i could download his data.
Im using last version of Symfony, Doctrine and PHP Unit.
CodePudding user response:
You are looking for Integration tests with symfony and you will face prerequisites (fixtures, test database, api call via WebTestCase
class, ...).
It's a bit longer to explain in details, so all you want is in this page: https://symfony.com/doc/current/testing.html