class SchemaLegacyTest
Deprecation tests cases for the schema API.
@group legacy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\AssertHelperTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpunitCompatibilityTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Database\SchemaLegacyTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of SchemaLegacyTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ SchemaLegacyTest.php, line 13
Namespace
Drupal\KernelTests\Core\DatabaseView source
class SchemaLegacyTest extends KernelTestBase {
/**
* 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
*/
public function testSchemaGetFieldValue() {
$info = [
'type' => 'int',
];
$value = 1.1;
$this->assertEquals(SqlContentEntityStorageSchema::castValue($info, $value), drupal_schema_get_field_value($info, $value));
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
SchemaLegacyTest::testSchemaGetFieldValue | public | function | Tests deprecation of the drupal_schema_get_field_value() function. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.