You are here

public function KernelTestBaseTest::testKernelTestBaseInstallSchema in Drupal 9

Tests the deprecation of ::installSchema with the tables key_value(_expire).

@group legacy

File

core/tests/Drupal/KernelTests/KernelTestBaseTest.php, line 417

Class

KernelTestBaseTest
@coversDefaultClass \Drupal\KernelTests\KernelTestBase

Namespace

Drupal\KernelTests

Code

public function testKernelTestBaseInstallSchema() {
  $this
    ->expectDeprecation('Installing the tables key_value and key_value_expire with the method KernelTestBase::installSchema() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The tables are now lazy loaded and therefore will be installed automatically when used. See https://www.drupal.org/node/3143286');
  $this
    ->enableModules([
    'system',
  ]);
  $this
    ->installSchema('system', [
    'key_value',
    'key_value_expire',
  ]);
  $this
    ->assertFalse(Database::getConnection()
    ->schema()
    ->tableExists('key_value'));
}