- 🇺🇸United States mile23 Seattle, WA
FTR: drupal/core-dev now requires colinodell/psr-testlogger, which meets these needs.
There doesn't appear to be an easy or consistent way for tests to assert that a message has been logged (via a logger channel, not to the screen).
The workaround is to enable the dblog module for any test needing to assert that a message is logged, but this seems overly complicated.
Add a test logger channel for kernel and browser tests, and a method assertLog()
to the base classes (via a trait). Since log messages need to persist past page requests (for Browser tests anyway), either the state backend, or a cache backend, can be used to store the logs for the duration of the test.
Closed: duplicate
9.4
Enhances developer experience.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
FTR: drupal/core-dev now requires colinodell/psr-testlogger, which meets these needs.