function FieldStorageCrudTest::testCreateWithExplicitSchema
Same name in other branches
- 9 core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php \Drupal\Tests\field\Kernel\FieldStorageCrudTest::testCreateWithExplicitSchema()
- 8.9.x core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php \Drupal\Tests\field\Kernel\FieldStorageCrudTest::testCreateWithExplicitSchema()
- 11.x core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php \Drupal\Tests\field\Kernel\FieldStorageCrudTest::testCreateWithExplicitSchema()
Tests that an explicit schema can be provided on creation.
This behavior is needed to allow field storage creation within updates, since plugin classes (and thus the field type schema) cannot be accessed.
File
-
core/
modules/ field/ tests/ src/ Kernel/ FieldStorageCrudTest.php, line 190
Class
- FieldStorageCrudTest
- Tests field storage create, read, update, and delete.
Namespace
Drupal\Tests\field\KernelCode
public function testCreateWithExplicitSchema() : void {
$schema = [
'dummy' => 'foobar',
];
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_2',
'entity_type' => 'entity_test',
'type' => 'test_field',
'schema' => $schema,
]);
$this->assertEquals($schema, $field_storage->getSchema());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.