only in patch2: unchanged: --- a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php +++ b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php @@ -476,7 +476,7 @@ public function testTableNames() { // Note: we need to test entity types with long names. We therefore use // fields on imaginary entity types (works as long as we don't actually save // them), and just check the generated table names. - + // // Short entity type and field name. $entity_type = 'short_entity_type'; $field_name = 'short_field_name'; @@ -490,7 +490,7 @@ public function testTableNames() { $expected = 'short_entity_type_revision__short_field_name'; $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected); - // Short entity type, long field name + // Short entity type, long field name. $entity_type = 'short_entity_type'; $field_name = 'long_field_name_abcdefghijklmnopqrstuvwxyz'; $field_storage = entity_create('field_storage_config', array( @@ -503,7 +503,7 @@ public function testTableNames() { $expected = 'short_entity_type_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected); - // Long entity type, short field name + // Long entity type, short field name. $entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz'; $field_name = 'short_field_name'; $field_storage = entity_create('field_storage_config', array( @@ -548,6 +548,10 @@ public function testTableNames() { $this->assertEqual($this->tableMapping->getDedicatedDataTableName($field_storage, TRUE), $expected); $expected = 'field_deleted_revision_' . substr(hash('sha256', $field_storage->uuid()), 0, 10); $this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage, TRUE), $expected); + + // Since the cardinality of the field is greater than 1, the table name + // retrieved from getFieldTableName() should be the dedicated table. + $this->assertEqual($this->tableMapping->getFieldTableName($this->fieldName), $this->tableMapping->getDedicatedDataTableName($this->fieldStorage)); } }