function SqlContentEntityStorageSchemaTest::testCastValue

Tests various value casts depending on column schema.

@legacy-covers ::castValue

Attributes

#[DataProvider('providerSchemaCastValue')]

Parameters

mixed $expected: The expected value.

mixed $value: The tested value.

array $schema: The schema for the table column.

File

core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php, line 1564

Class

SqlContentEntityStorageSchemaTest
Tests Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema.

Namespace

Drupal\Tests\Core\Entity\Sql

Code

public function testCastValue($expected, $value, array $schema) : void {
  $this->assertSame($expected, SqlContentEntityStorageSchema::castValue($schema, $value));
}

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