Codeception upgrade from 5.0.12 -> 5.0.13 breaks API test suite
When upgrading codeception/codeception to 5.0.13, running the API test suite like this:
FS_ENV=test scripts/docker-compose exec app vendor/bin/codecept run Api
yields an error message:
Service dispatcher is not defined and can't be accessed from a test
It's indirectly caused by this recently merged PR: https://github.com/Codeception/Codeception/pull/6696
The reason this is happening to us is that we're calling haveHttpHeader
in our ApiTester's constructor. With that PR, our Actor is instantiated earlier, before the infrastructure necessary to execute actions (namely, the dispatcher service) is ready.
We will need to find an equivalent method to set this CSRF header for every test somehow that is not the Actor's constructor. Maybe there are hooks we can make use of?