function SchemaDeprecationTest::testDeprecatedInstallSchema
Tests deprecation of database schema API functions.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ SchemaDeprecationTest.php, line 23
Class
- SchemaDeprecationTest
- Tests deprecated schema.inc functions.
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testDeprecatedInstallSchema() {
$this->expectDeprecation('drupal_install_schema() 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_install_schema('dblog');
$table = 'watchdog';
$this->expectDeprecation('drupal_get_module_schema() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. No direct replacement is provided. Testing classes could use \\Drupal\\TestTools\\Extension\\SchemaInspector for introspection. See https://www.drupal.org/node/2970993');
$this->assertArrayHasKey($table, drupal_get_module_schema('dblog'));
$this->assertTrue(\Drupal::database()->schema()
->tableExists($table));
$this->expectDeprecation('drupal_uninstall_schema() 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_uninstall_schema('dblog');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.