public function EntityDefinitionUpdateTest::testLongNameFieldIndexes in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testLongNameFieldIndexes()
- 9 core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testLongNameFieldIndexes()
Check that field schema is correctly handled with long-named fields.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityDefinitionUpdateTest.php, line 1184
Class
- EntityDefinitionUpdateTest
- Tests EntityDefinitionUpdateManager functionality.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testLongNameFieldIndexes() {
$this
->addLongNameBaseField();
$entity_type_id = 'entity_test_update';
$entity_type = $this->entityTypeManager
->getDefinition($entity_type_id);
$definitions = EntityTestUpdate::baseFieldDefinitions($entity_type);
$name = 'new_long_named_entity_reference_base_field';
$this->entityDefinitionUpdateManager
->installFieldStorageDefinition($name, $entity_type_id, 'entity_test', $definitions[$name]);
$this
->assertFalse($this->entityDefinitionUpdateManager
->needsUpdates(), 'Entity and field schema data are correctly detected.');
}