- ๐บ๐ธUnited States mglaman WI, USA
I have stopped writing Functional tests and always use Kernel tests.
Hereโs a bunch of examples Iโve done: https://git.drupalcode.org/project/google_tag/-/tree/2.0.x/tests/src/Ker...
It handles requests by passing it to the HTTP kernel. The above even tests user register and login.
That code is based on a personal library I use: https://github.com/mglaman/drupal-test-helpers
- ๐ฌ๐งUnited Kingdom joachim
Found a few more.
Sniff: calling $container->set() in a browser test is a dead giveaway -- it will have no effect on the SUT since that is getting the service container from cache or building it from YAML files!
- ๐ฌ๐งUnited Kingdom catch
FormElementsLabelTest is a potential candidate here - at least the last method does not http requests.