G
G
George2019-08-13 09:53:36
symfony
George, 2019-08-13 09:53:36

How to test bundles in Symfony 4?

When creating a module (bundle), there were difficulties in writing a unit test. Project on Symfony 4 WebSocketBundle
When running the tests on the main application, there were no problems, but when running the tests separately from the main application, they got an error about the need to set KERNEL_CLASS.
What's the best way to test?
from options:

  • rewrite tests without dependency on symfony DI
  • implement the AppKernel in the test environment.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question