Quantcast
Viewing all articles
Browse latest Browse all 295617

Replace usage of dblog module at tests with alternative

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:

  1. Using \Symfony\Component\ErrorHandler\BufferingLogger. Example: #3495091: Use BufferingLogger at SmartDefaultSettingsTest
  2. Implement LoggerInterface and log() 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

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 295617


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>