function DefaultTableMappingIntegrationTest::testGetFieldTableName

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php \Drupal\KernelTests\Core\Entity\DefaultTableMappingIntegrationTest::testGetFieldTableName()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php \Drupal\KernelTests\Core\Entity\DefaultTableMappingIntegrationTest::testGetFieldTableName()
  3. 11.x core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php \Drupal\KernelTests\Core\Entity\DefaultTableMappingIntegrationTest::testGetFieldTableName()

Tests DefaultTableMapping::getFieldTableName().

@covers ::getFieldTableName

File

core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php, line 77

Class

DefaultTableMappingIntegrationTest
Tests the default table mapping class for content entities stored in SQL.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testGetFieldTableName() {
    // Test the field table name for a single-valued base field, which is stored
    // in the entity's base table.
    $expected = 'entity_test_mulrev';
    $this->assertEquals($this->tableMapping
        ->getFieldTableName('uuid'), $expected);
    // Test the field table name for a translatable and revisionable base field,
    // which is stored in the entity's data table.
    $expected = 'entity_test_mulrev_property_data';
    $this->assertEquals($this->tableMapping
        ->getFieldTableName('name'), $expected);
    // Test the field table name for a multi-valued base field, which is stored
    // in a dedicated table.
    $expected = 'entity_test_mulrev__multivalued_base_field';
    $this->assertEquals($this->tableMapping
        ->getFieldTableName('multivalued_base_field'), $expected);
}

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