function KernelTestBaseTest::testKernelTestBaseInstallSchema

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

@group legacy

File

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

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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.