function SchemaLegacyTest::testSchemaGetFieldValue
Tests deprecation of the drupal_schema_get_field_value() function.
@expectedDeprecation drupal_schema_get_field_value() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::castValue($info, $value) instead. See https://www.drupal.org/node/3051983
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ SchemaLegacyTest.php, line 20
Class
- SchemaLegacyTest
- Deprecation tests cases for the schema API.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testSchemaGetFieldValue() {
$info = [
'type' => 'int',
];
$value = 1.1;
$this->assertEquals(SqlContentEntityStorageSchema::castValue($info, $value), drupal_schema_get_field_value($info, $value));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.