Problem/Motivation
This is follow-up issue from #3496117: Remove unnecessary usage of dblog module at tests.
Some tests use dblog module to check log messages, this requires database connection.
In order to simplify this and improve test speed, we can use some alternatives.
Steps to reproduce
Check the code base.
Proposed resolution
For kernel tests there are options:
- Using
\Symfony\Component\ErrorHandler\BufferingLogger
. Example: #3495091: Use BufferingLogger at SmartDefaultSettingsTest - Implement
LoggerInterface
andlog()
at test class. Example: 59ce5ede
For some Functional tests these 2 options should work as well.
Remaining tasks
Decide what approach is better for each, and implement changes.
- Drupal\Tests\comment\Kernel\CommentIntegrationTest
- Drupal\Tests\field_ui\Kernel\EntityDisplayTest
- Drupal\Tests\image\Kernel\ImageItemTest
- Drupal\Tests\jsonapi\Kernel\ResourceType\RelatedResourceTypesTest
- Drupal\KernelTests\Core\Action\EmailActionTest
These functional tests maybe we can also make replacement, but this need to be discussed.
- Drupal\Tests\big_pipe\Functional\BigPipeTest
- Drupal\Tests\media\FunctionalJavascript\MediaSourceOEmbedVideoTest
- Drupal\Tests\node\FunctionalNodeCreationTest
- Drupal\Tests\system\Functional\Module\ModuleTestBase