You are here

public function SchemaDeprecationTest::testDeprecatedSchemaInitialize in Drupal 9

Tests deprecation of _drupal_schema_initialize() function.

File

core/tests/Drupal/KernelTests/Core/Extension/SchemaDeprecationTest.php, line 37

Class

SchemaDeprecationTest
Tests deprecated schema.inc functions.

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testDeprecatedSchemaInitialize() {
  $module = 'dblog';
  $table = 'watchdog';
  $schema = [
    $table => [],
  ];
  $this
    ->expectDeprecation('_drupal_schema_initialize() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/2970993');
  _drupal_schema_initialize($schema, $module, FALSE);
  $this
    ->assertEquals($module, $schema[$table]['module']);
  $this
    ->assertEquals($table, $schema[$table]['name']);
}