You are here

public function DatabaseLegacyTest::testDbFieldSetDefault in Drupal 8

Tests deprecation of the db_field_set_default() function.

@expectedDeprecation db_field_set_default() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033 @expectedDeprecation fieldSetDefault() is deprecated in drupal:8.7.0 and will be removed before drupal:9.0.0. Instead, call ::changeField() passing a full field specification. See https://www.drupal.org/node/2999035 @doesNotPerformAssertions

File

core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php, line 143

Class

DatabaseLegacyTest
Deprecation tests cases for the database layer.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testDbFieldSetDefault() {
  db_field_set_default('test', 'job', 'baz');
}