You are here

function EntityDefinitionUpdateTest::testLongNameFieldIndexes in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php \Drupal\system\Tests\Entity\EntityDefinitionUpdateTest::testLongNameFieldIndexes()

Check that field schema is correctly handled with long-named fields.

File

core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php, line 803
Contains \Drupal\system\Tests\Entity\EntityDefinitionUpdateTest.

Class

EntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager functionality.

Namespace

Drupal\system\Tests\Entity

Code

function testLongNameFieldIndexes() {
  $this
    ->addLongNameBaseField();
  $entity_type_id = 'entity_test_update';
  $entity_type = $this->entityManager
    ->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.');
}