diff --git a/core/composer.txt b/core/composer.txt new file mode 100644 index 0000000..51f132b --- /dev/null +++ b/core/composer.txt @@ -0,0 +1,34 @@ +The libraries listed here are the only ones we officially depend on. Anything +else is either provided only for development purposes or an implicit dependency +that may be removed in the future, if it is properly decoupled from the packages +depending on it. + +doctrine/common +doctrine/annotations +easyrdf/easyrdf +egulias/email-validator +fabpot/goutte +guzzlehttp/guzzle +masterminds/html5 +paragonie/random_compat +stack/builder +symfony/class-loader +symfony/console +symfony/dependency-injection +symfony/event-dispatcher +symfony/http-foundation +symfony/http-kernel +symfony/polyfill-iconv +symfony/routing +symfony/serializer +symfony/validator +symfony/process +symfony/yaml +symfony-cmf/routing +symfony/psr-http-message-bridge +twig/twig +zendframework/zend-diactoros +zendframework/zend-feed + +If you are writing code that depends on a library not listed here, you should +add it explicitly as a dependency yourself in your own "composer.json" file. diff --git a/core/core.services.yml b/core/core.services.yml index d9b1839..5877a38 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -80,6 +80,11 @@ services: arguments: ['@request_stack'] tags: - { name: cache.context } + cache_context.url.path.parent: + class: Drupal\Core\Cache\Context\PathParentCacheContext + arguments: ['@request_stack'] + tags: + - { name: cache.context } cache_context.url.query_args: class: Drupal\Core\Cache\Context\QueryArgsCacheContext arguments: ['@request_stack'] diff --git a/core/lib/Drupal/Core/Cache/Context/PathParentCacheContext.php b/core/lib/Drupal/Core/Cache/Context/PathParentCacheContext.php new file mode 100644 index 0000000..59f4804 --- /dev/null +++ b/core/lib/Drupal/Core/Cache/Context/PathParentCacheContext.php @@ -0,0 +1,41 @@ +requestStack->getCurrentRequest(); + $path_elements = explode('/', trim($request->getPathInfo(), '/')); + array_pop($path_elements); + return implode('/', $path_elements); + } + + /** + * {@inheritdoc} + */ + public function getCacheableMetadata() { + return new CacheableMetadata(); + } + +} diff --git a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php index b1f6abd..c3cef7c 100644 --- a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php +++ b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php @@ -52,7 +52,7 @@ class DefaultHtmlRouteProvider implements EntityRouteProviderInterface, EntityHa * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager * The entity field manager. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager) { $this->entityTypeManager = $entity_type_manager; $this->entityFieldManager = $entity_field_manager; } diff --git a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php index b229d3a..8ee00bd 100644 --- a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php +++ b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php @@ -147,16 +147,15 @@ public function getFieldTableName($field_name) { // https://www.drupal.org/node/2274017. /** @var \Drupal\Core\Entity\Sql\SqlContentEntityStorage $storage */ $storage = \Drupal::entityManager()->getStorage($this->entityType->id()); - $storage_definition = $this->fieldStorageDefinitions[$field_name]; $table_names = array( $storage->getDataTable(), $storage->getBaseTable(), $storage->getRevisionTable(), - $this->getDedicatedDataTableName($storage_definition), ); // Collect field columns. $field_columns = array(); + $storage_definition = $this->fieldStorageDefinitions[$field_name]; foreach (array_keys($storage_definition->getColumns()) as $property_name) { $field_columns[] = $this->getFieldColumnName($storage_definition, $property_name); } diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php index 0543651..a0a0467 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -282,13 +282,13 @@ public function getTableMapping(array $storage_definitions = NULL) { $definitions = $storage_definitions ?: $this->entityManager->getFieldStorageDefinitions($this->entityTypeId); $table_mapping = new DefaultTableMapping($this->entityType, $definitions); - $shared_table_definitions = array_filter($definitions, function (FieldStorageDefinitionInterface $definition) use ($table_mapping) { + $definitions = array_filter($definitions, function (FieldStorageDefinitionInterface $definition) use ($table_mapping) { return $table_mapping->allowsSharedTableStorage($definition); }); $key_fields = array_values(array_filter(array($this->idKey, $this->revisionKey, $this->bundleKey, $this->uuidKey, $this->langcodeKey))); - $all_fields = array_keys($shared_table_definitions); - $revisionable_fields = array_keys(array_filter($shared_table_definitions, function (FieldStorageDefinitionInterface $definition) { + $all_fields = array_keys($definitions); + $revisionable_fields = array_keys(array_filter($definitions, function (FieldStorageDefinitionInterface $definition) { return $definition->isRevisionable(); })); // Make sure the key fields come first in the list of fields. @@ -355,7 +355,7 @@ public function getTableMapping(array $storage_definitions = NULL) { } // Add dedicated tables. - $dedicated_table_definitions = array_filter($definitions, function (FieldStorageDefinitionInterface $definition) use ($table_mapping) { + $definitions = array_filter($definitions, function (FieldStorageDefinitionInterface $definition) use ($table_mapping) { return $table_mapping->requiresDedicatedTableStorage($definition); }); $extra_columns = array( @@ -366,12 +366,8 @@ public function getTableMapping(array $storage_definitions = NULL) { 'langcode', 'delta', ); - foreach ($dedicated_table_definitions as $field_name => $definition) { - $tables = [$table_mapping->getDedicatedDataTableName($definition)]; - if ($revisionable && $definition->isRevisionable()) { - $tables[] = $table_mapping->getDedicatedRevisionTableName($definition); - } - foreach ($tables as $table_name) { + foreach ($definitions as $field_name => $definition) { + foreach (array($table_mapping->getDedicatedDataTableName($definition), $table_mapping->getDedicatedRevisionTableName($definition)) as $table_name) { $table_mapping->setFieldNames($table_name, array($field_name)); $table_mapping->setExtraColumns($table_name, $extra_columns); } @@ -1586,13 +1582,7 @@ public function finalizePurge(FieldStorageDefinitionInterface $storage_definitio * {@inheritdoc} */ public function countFieldData($storage_definition, $as_bool = FALSE) { - // The table mapping contains stale data during a request when a field - // storage definition is added, so bypass the internal storage definitions - // and fetch the table mapping using the passed in storage definition. - // @todo Fix this in https://www.drupal.org/node/2705205. - $storage_definitions = $this->entityManager->getFieldStorageDefinitions($this->entityTypeId); - $storage_definitions[$storage_definition->getName()] = $storage_definition; - $table_mapping = $this->getTableMapping($storage_definitions); + $table_mapping = $this->getTableMapping(); if ($table_mapping->requiresDedicatedTableStorage($storage_definition)) { $is_deleted = $this->storageDefinitionIsDeleted($storage_definition); diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php index 945c5bc..8ea227c 100644 --- a/core/lib/Drupal/Core/Template/Attribute.php +++ b/core/lib/Drupal/Core/Template/Attribute.php @@ -312,7 +312,7 @@ public function toArray() { /** * Implements the magic __clone() method. */ - public function __clone() { + public function __clone() { foreach ($this->storage as $name => $value) { $this->storage[$name] = clone $value; } diff --git a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php index 7683ea1..04ff9c4 100644 --- a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php +++ b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php @@ -91,7 +91,7 @@ public function testThemeBreakpoints() { /** * Test the custom breakpoint group provided by a theme and a module. */ - public function testCustomBreakpointGroups() { + public function testCustomBreakpointGroups () { // Verify the breakpoint group for breakpoint_theme_test.group2 was created. $expected_breakpoints = array( 'breakpoint_theme_test.group2.narrow' => array( diff --git a/core/modules/node/src/Tests/NodeCreationTest.php b/core/modules/node/src/Tests/NodeCreationTest.php index 5071056..59a0a7b 100644 --- a/core/modules/node/src/Tests/NodeCreationTest.php +++ b/core/modules/node/src/Tests/NodeCreationTest.php @@ -164,7 +164,7 @@ public function testAuthorAutocomplete() { /** * Check node/add when no node types exist. */ - function testNodeAddWithoutContentTypes() { + function testNodeAddWithoutContentTypes () { $this->drupalGet('node/add'); $this->assertResponse(200); $this->assertNoLinkByHref('/admin/structure/types/add'); diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php index b4871b7..b4dce56 100644 --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -25,7 +25,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { 'theme', 'route', 'timezone', - 'url.path', + 'url.path.parent', 'url.query_args:_wrapper_format', 'user' ]; diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 58ede7c..4dc7544 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -181,8 +181,6 @@ function simpletest_run_tests($test_list) { function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames, &$status = NULL) { $phpunit_file = simpletest_phpunit_xml_filepath($test_id); simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file, $status); - - $rows = simpletest_phpunit_xml_to_rows($test_id, $phpunit_file); // A $status of 0 = passed test, 1 = failed test, > 1 indicates segfault // timeout, or other type of failure. if ($status > 1) { @@ -199,6 +197,9 @@ function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames 'file' => $phpunit_file, ]; } + else { + $rows = simpletest_phpunit_xml_to_rows($test_id, $phpunit_file); + } return $rows; } diff --git a/core/modules/system/src/PathBasedBreadcrumbBuilder.php b/core/modules/system/src/PathBasedBreadcrumbBuilder.php index 060f1b1..dcfc073 100644 --- a/core/modules/system/src/PathBasedBreadcrumbBuilder.php +++ b/core/modules/system/src/PathBasedBreadcrumbBuilder.php @@ -136,9 +136,9 @@ public function build(RouteMatchInterface $route_match) { // /user is just a redirect, so skip it. // @todo Find a better way to deal with /user. $exclude['/user'] = TRUE; - // Because this breadcrumb builder is entirely path-based, vary by the - // 'url.path' cache context. - $breadcrumb->addCacheContexts(['url.path']); + // Add the url.path.parent cache context. This code ignores the last path + // part so the result only depends on the path parents. + $breadcrumb->addCacheContexts(['url.path.parent']); while (count($path_elements) > 1) { array_pop($path_elements); // Copy the path elements for up-casting. diff --git a/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php b/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php index ceab801..19384c9 100644 --- a/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php +++ b/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php @@ -67,9 +67,6 @@ public function testSingleUpdates() { $this->enableUpdates('entity_test', 'entity_definition_updates', 8001); $this->applyUpdates(); - // Ensure the 'entity_test__user_id' table got created. - $this->assertTrue(\Drupal::database()->schema()->tableExists('entity_test__user_id')); - // Check that data was correctly migrated. $entity = $this->reloadEntity($entity); $this->assertEqual(count($entity->user_id), 1); diff --git a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php index 29f0cea..eb095a7 100644 --- a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php +++ b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php @@ -142,7 +142,7 @@ public function testBuildOnFrontpage() { $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface')); $this->assertEquals([], $breadcrumb->getLinks()); - $this->assertEquals(['url.path'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['url.path.parent'], $breadcrumb->getCacheContexts()); $this->assertEquals([], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } @@ -159,7 +159,7 @@ public function testBuildWithOnePathElement() { $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface')); $this->assertEquals([0 => new Link('Home', new Url(''))], $breadcrumb->getLinks()); - $this->assertEquals(['url.path'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['url.path.parent'], $breadcrumb->getCacheContexts()); $this->assertEquals([], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } @@ -194,7 +194,7 @@ public function testBuildWithTwoPathElements() { $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface')); $this->assertEquals([0 => new Link('Home', new Url('')), 1 => new Link('Example', new Url('example'))], $breadcrumb->getLinks()); - $this->assertEquals(['url.path', 'user.permissions'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['url.path.parent', 'user.permissions'], $breadcrumb->getCacheContexts()); $this->assertEquals([], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } @@ -245,7 +245,7 @@ public function testBuildWithThreePathElements() { new Link('Example', new Url('example')), new Link('Bar', new Url('example_bar')), ], $breadcrumb->getLinks()); - $this->assertEquals(['bar', 'url.path', 'user.permissions'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['bar', 'url.path.parent', 'user.permissions'], $breadcrumb->getCacheContexts()); $this->assertEquals(['example'], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } @@ -272,7 +272,7 @@ public function testBuildWithException($exception_class, $exception_argument) { // No path matched, though at least the frontpage is displayed. $this->assertEquals([0 => new Link('Home', new Url(''))], $breadcrumb->getLinks()); - $this->assertEquals(['url.path'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['url.path.parent'], $breadcrumb->getCacheContexts()); $this->assertEquals([], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } @@ -316,7 +316,7 @@ public function testBuildWithNonProcessedPath() { // No path matched, though at least the frontpage is displayed. $this->assertEquals([0 => new Link('Home', new Url(''))], $breadcrumb->getLinks()); - $this->assertEquals(['url.path'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['url.path.parent'], $breadcrumb->getCacheContexts()); $this->assertEquals([], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } @@ -364,7 +364,7 @@ public function testBuildWithUserPath() { $breadcrumb = $this->builder->build($this->getMock('Drupal\Core\Routing\RouteMatchInterface')); $this->assertEquals([0 => new Link('Home', new Url('')), 1 => new Link('Admin', new Url('user_page'))], $breadcrumb->getLinks()); - $this->assertEquals(['url.path', 'user.permissions'], $breadcrumb->getCacheContexts()); + $this->assertEquals(['url.path.parent', 'user.permissions'], $breadcrumb->getCacheContexts()); $this->assertEquals([], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index e41efa9..d8dc82f 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -235,7 +235,7 @@ public function getViewsData() { // Load all typed data definitions of all fields. This should cover each of // the entity base, revision, data tables. $field_definitions = $this->entityManager->getBaseFieldDefinitions($this->entityType->id()); - if ($table_mapping = $this->storage->getTableMapping($field_definitions)) { + if ($table_mapping = $this->storage->getTableMapping()) { // Fetch all fields that can appear in both the base table and the data // table. $entity_keys = $this->entityType->getKeys(); diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 12eeb7b..0a4cc48 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2262,7 +2262,7 @@ public function preExecute() { /** * {@inheritdoc} */ - public function calculateCacheMetadata() { + public function calculateCacheMetadata () { $cache_metadata = new CacheableMetadata(); // Iterate over ordinary views plugins. diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index c223745..150881c 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -20,8 +20,6 @@ - - diff --git a/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php b/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php new file mode 100644 index 0000000..a0a3701 --- /dev/null +++ b/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php @@ -0,0 +1,48 @@ +placeBlock('system_breadcrumb_block', ['id' => 'breadcrumb']); + + // Prone the cache first. + $this->drupalGet('/not-found-1'); + $base_count = count($this->getBreadcrumbCacheEntries()); + + $this->drupalGet('/not-found-2'); + $next_count = count($this->getBreadcrumbCacheEntries()); + $this->assertEquals($base_count, $next_count); + + $this->drupalGet('/not-found-3'); + $next_count = count($this->getBreadcrumbCacheEntries()); + $this->assertEquals($base_count, $next_count); + } + + protected function getBreadcrumbCacheEntries() { + $database = \Drupal::database(); + $cache_entries = $database->select('cache_render') + ->fields('cache_render') + ->condition('cid', $database->escapeLike('entity_view:block:breadcrumb') . '%', 'LIKE') + ->execute() + ->fetchAllAssoc('cid'); + return $cache_entries; + } + +} diff --git a/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php deleted file mode 100644 index 8f945b3..0000000 --- a/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php +++ /dev/null @@ -1,71 +0,0 @@ -setName('multivalued_base_field') - ->setTargetEntityTypeId('entity_test_mulrev') - ->setTargetBundle('entity_test_mulrev') - ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); - $this->state->set('entity_test_mulrev.additional_base_field_definitions', $definitions); - - $this->entityManager->clearCachedDefinitions(); - $this->tableMapping = $this->entityManager->getStorage('entity_test_mulrev')->getTableMapping(); - } - - /** - * Tests DefaultTableMapping::getFieldTableName(). - * - * @covers ::getFieldTableName - */ - 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); - } - -} diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php new file mode 100644 index 0000000..523dd8a --- /dev/null +++ b/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php @@ -0,0 +1,45 @@ +push($request); + $cache_context = new PathParentCacheContext($request_stack); + $this->assertSame($cache_context->getContext(), $context); + } + + /** + * Provides a list of paths and expected cache contexts. + */ + public function providerTestGetContext() { + return [ + ['/some/path', 'some'], + ['/some/other-path', 'some'], + ['/some/other/path', 'some/other'], + ['/some/other/path?q=foo&b=bar', 'some/other'], + ['/some', ''], + ['/', ''], + ]; + } + +} diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php index 02970d7..34013c4 100644 --- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php @@ -467,42 +467,6 @@ public function providerTestGetTableMappingSimple() { } /** - * Tests getTableMapping() with a base field that requires a dedicated table. - * - * @covers ::__construct - * @covers ::getTableMapping - */ - public function testGetTableMappingSimpleWithDedicatedStorageFields() { - $base_field_names = ['multi_valued_base_field']; - - // Set up one entity key in order to have a base table. - $this->fieldDefinitions = $this->mockFieldDefinitions(['test_id']); - - // Set up the multi-valued base field. - $this->fieldDefinitions += $this->mockFieldDefinitions($base_field_names, [ - 'hasCustomStorage' => FALSE, - 'isMultiple' => TRUE, - 'getTargetEntityTypeId' => 'entity_test', - ]); - - $this->setUpEntityStorage(); - - $mapping = $this->entityStorage->getTableMapping(); - $this->assertEquals(['entity_test', 'entity_test__multi_valued_base_field'], $mapping->getTableNames()); - $this->assertEquals($base_field_names, $mapping->getFieldNames('entity_test__multi_valued_base_field')); - - $extra_columns = array( - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - ); - $this->assertEquals($extra_columns, $mapping->getExtraColumns('entity_test__multi_valued_base_field')); - } - - /** * Tests getTableMapping() with a revisionable, non-translatable entity type. * * @param string[] $entity_keys