We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Unittest error

Hi,

I've got a little problem with my unit tests. I need to initialize some variables in my test class. I do it in my setUp() function. Of course i do a parent::setUp() in it.

I've got 2 function in my test class. The first is ok, and when it execute the second i've got this error : "Service 'db' was not found in the dependency injection container"

It seems like DI is completly reset or something! Any ideas on the subject ?



7.9k

could please post your code snippet here?

have you make sure register 'db' in DI?