G
G
grabbee2021-11-23 22:17:39
symfony
grabbee, 2021-11-23 22:17:39

How to do integration tests in symfony bundle?

To test services and controllers, you need a kernel. But I only need it for tests. And everything else is also just to run the tests. First I put Kernel in src and the kernel seems to be automatically loaded after installing the bundle. And I don't need it. Moved Kernel to tests
* What else needs to be changed so that after installing the extra stuff is not loaded from the bundle?

The bundle structure is like a regular application. There is also services.yaml in the config folder and there I registered which services are public for testing. There are bundles.php and so on. Will it interfere?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2021-11-23
@grabbee

This article https://habr.com/en/post/500044/ details how to test a bundle. There are also links to creating a bundle and publishing it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question