See #2848161: [meta] Replace calls to deprecated db_*() wrappers

Problem/Motivation

Using the RegressionTest class for deprecation tests is confusing. In the parent issue the testDbTableExist method has been changed to track deprecation, which means that it will be dropped in 9.0 when the db* wrappers will be removed from code. But that test is pre-existing and should not be dropped.

Proposed resolution

Add a DatabaseLegacyTest class for deprecation tests only, and move the tests already coded there.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Title: Replace all calls to db_table_exists, which is deprecated. » Introduce a DatabaseLegacyTest class for deprecation testing
Status: Active » Needs review
FileSize
4.14 KB
voleger’s picture

Status: Needs review » Needs work
+++ b/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php
@@ -0,0 +1,42 @@
+
+use Drupal\Core\Database\Database;

This is redundant code.
DatabaseTestBase already has database connection injected into connection property.

mondrake’s picture

Status: Needs work » Needs review
FileSize
4.11 KB
495 bytes

Indeed, thank you @voleger

voleger’s picture

Status: Needs review » Reviewed & tested by the community

Tests are "green". +1 for RTBC
And let's continue with replacing deprecated db_* functions.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 3f44f5bbcb to 8.7.x and c4c573303d to 8.6.x. Thanks!

alexpott’s picture

Backported to 8.6.x since this is a test-only change.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.