diff --git a/core/modules/aggregator/tests/src/Functional/FeedCacheTagsTest.php b/core/modules/aggregator/tests/src/Functional/FeedCacheTagsTest.php index dc0aab9263e..0cf6d1d0312 100644 --- a/core/modules/aggregator/tests/src/Functional/FeedCacheTagsTest.php +++ b/core/modules/aggregator/tests/src/Functional/FeedCacheTagsTest.php @@ -3,7 +3,7 @@ namespace Drupal\Tests\aggregator\Functional; use Drupal\aggregator\Entity\Feed; -use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase; +use Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase; use Drupal\user\Entity\Role; use Drupal\user\RoleInterface; diff --git a/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php b/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php index 09da3436827..edd2ac32a92 100644 --- a/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php +++ b/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php @@ -5,7 +5,7 @@ namespace Drupal\Tests\aggregator\Functional; use Drupal\aggregator\Entity\Feed; use Drupal\aggregator\Entity\Item; use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\system\Tests\Entity\EntityCacheTagsTestBase; +use Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase; use Drupal\user\Entity\Role; use Drupal\user\RoleInterface; diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php index 68350092850..ea5dd2873de 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php @@ -7,7 +7,7 @@ use Drupal\block_content\Entity\BlockContentType; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Language\LanguageInterface; -use Drupal\system\Tests\Entity\EntityCacheTagsTestBase; +use Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase; use Symfony\Component\HttpFoundation\Request; /** diff --git a/core/modules/comment/src/Tests/CommentCacheTagsTest.php b/core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php similarity index 96% rename from core/modules/comment/src/Tests/CommentCacheTagsTest.php rename to core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php index 12e0ef8451b..0b0f4863afe 100644 --- a/core/modules/comment/src/Tests/CommentCacheTagsTest.php +++ b/core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php @@ -1,14 +1,15 @@ _view" + * - ":" + */ + public function testEntityUri() { + $entity_url = $this->entity->urlInfo(); + $entity_type = $this->entity->getEntityTypeId(); + + // Selects the view mode that will be used. + $view_mode = $this->selectViewMode($entity_type); + + // The default cache contexts for rendered entities. + $entity_cache_contexts = $this->getDefaultCacheContexts(); + + // Generate the standardized entity cache tags. + $cache_tag = $this->entity->getCacheTags(); + $view_cache_tag = \Drupal::entityManager()->getViewBuilder($entity_type)->getCacheTags(); + $render_cache_tag = 'rendered'; + + $this->pass("Test entity.", 'Debug'); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit, but also the presence of the correct cache tags. + $this->verifyPageCache($entity_url, 'HIT'); + + // Also verify the existence of an entity render cache entry, if this entity + // type supports render caching. + if (\Drupal::entityManager()->getDefinition($entity_type)->isRenderCacheable()) { + $cache_keys = ['entity_view', $entity_type, $this->entity->id(), $view_mode]; + $cid = $this->createCacheId($cache_keys, $entity_cache_contexts); + $redirected_cid = NULL; + $additional_cache_contexts = $this->getAdditionalCacheContextsForEntity($this->entity); + if (count($additional_cache_contexts)) { + $redirected_cid = $this->createCacheId($cache_keys, Cache::mergeContexts($entity_cache_contexts, $additional_cache_contexts)); + } + $expected_cache_tags = Cache::mergeTags($cache_tag, $view_cache_tag); + $expected_cache_tags = Cache::mergeTags($expected_cache_tags, $this->getAdditionalCacheTagsForEntity($this->entity)); + $expected_cache_tags = Cache::mergeTags($expected_cache_tags, [$render_cache_tag]); + $this->verifyRenderCache($cid, $expected_cache_tags, $redirected_cid); + } + + // Verify that after modifying the entity, there is a cache miss. + $this->pass("Test modification of entity.", 'Debug'); + $this->entity->save(); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + + // Verify that after modifying the entity's display, there is a cache miss. + $this->pass("Test modification of entity's '$view_mode' display.", 'Debug'); + $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $view_mode); + $entity_display->save(); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + + if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { + // Verify that after modifying the corresponding bundle entity, there is a + // cache miss. + $this->pass("Test modification of entity's bundle entity.", 'Debug'); + $bundle_entity = $this->container->get('entity_type.manager') + ->getStorage($bundle_entity_type_id) + ->load($this->entity->bundle()); + $bundle_entity->save(); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + } + + if ($this->entity->getEntityType()->get('field_ui_base_route')) { + // Verify that after modifying a configurable field on the entity, there + // is a cache miss. + $this->pass("Test modification of entity's configurable field.", 'Debug'); + $field_storage_name = $this->entity->getEntityTypeId() . '.configurable_field'; + $field_storage = FieldStorageConfig::load($field_storage_name); + $field_storage->save(); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + + // Verify that after modifying a configurable field on the entity, there + // is a cache miss. + $this->pass("Test modification of entity's configurable field.", 'Debug'); + $field_name = $this->entity->getEntityTypeId() . '.' . $this->entity->bundle() . '.configurable_field'; + $field = FieldConfig::load($field_name); + $field->save(); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + } + + // Verify that after invalidating the entity's cache tag directly, there is + // a cache miss. + $this->pass("Test invalidation of entity's cache tag.", 'Debug'); + Cache::invalidateTags($this->entity->getCacheTagsToInvalidate()); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + + // Verify that after invalidating the generic entity type's view cache tag + // directly, there is a cache miss. + $this->pass("Test invalidation of entity's 'view' cache tag.", 'Debug'); + Cache::invalidateTags($view_cache_tag); + $this->verifyPageCache($entity_url, 'MISS'); + + // Verify a cache hit. + $this->verifyPageCache($entity_url, 'HIT'); + + // Verify that after deleting the entity, there is a cache miss. + $this->pass('Test deletion of entity.', 'Debug'); + $this->entity->delete(); + $this->verifyPageCache($entity_url, 'MISS'); + $this->assertResponse(404); + } + + /** + * Gets the default cache contexts for rendered entities. + * + * @return array + * The default cache contexts for rendered entities. + */ + protected function getDefaultCacheContexts() { + return ['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions']; + } + +} diff --git a/core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php b/core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php new file mode 100644 index 00000000000..e873e096f0d --- /dev/null +++ b/core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php @@ -0,0 +1,299 @@ +state->set('entity_test_new', TRUE); + $this->entityManager->clearCachedDefinitions(); + $this->entityDefinitionUpdateManager->applyUpdates(); + } + + /** + * Resets the entity type definition. + */ + protected function resetEntityType() { + $this->state->set('entity_test_update.entity_type', NULL); + $this->entityManager->clearCachedDefinitions(); + $this->entityDefinitionUpdateManager->applyUpdates(); + } + + /** + * Updates the 'entity_test_update' entity type to revisionable. + */ + protected function updateEntityTypeToRevisionable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $keys = $entity_type->getKeys(); + $keys['revision'] = 'revision_id'; + $entity_type->set('entity_keys', $keys); + $entity_type->set('revision_table', 'entity_test_update_revision'); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Updates the 'entity_test_update' entity type not revisionable. + */ + protected function updateEntityTypeToNotRevisionable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $keys = $entity_type->getKeys(); + unset($keys['revision']); + $entity_type->set('entity_keys', $keys); + $entity_type->set('revision_table', NULL); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Updates the 'entity_test_update' entity type to translatable. + */ + protected function updateEntityTypeToTranslatable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $entity_type->set('translatable', TRUE); + $entity_type->set('data_table', 'entity_test_update_data'); + + if ($entity_type->isRevisionable()) { + $entity_type->set('revision_data_table', 'entity_test_update_revision_data'); + } + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Updates the 'entity_test_update' entity type to not translatable. + */ + protected function updateEntityTypeToNotTranslatable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $entity_type->set('translatable', FALSE); + $entity_type->set('data_table', NULL); + + if ($entity_type->isRevisionable()) { + $entity_type->set('revision_data_table', NULL); + } + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Updates the 'entity_test_update' entity type to revisionable and + * translatable. + */ + protected function updateEntityTypeToRevisionableAndTranslatable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $keys = $entity_type->getKeys(); + $keys['revision'] = 'revision_id'; + $entity_type->set('entity_keys', $keys); + $entity_type->set('translatable', TRUE); + $entity_type->set('data_table', 'entity_test_update_data'); + $entity_type->set('revision_table', 'entity_test_update_revision'); + $entity_type->set('revision_data_table', 'entity_test_update_revision_data'); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Adds a new base field to the 'entity_test_update' entity type. + * + * @param string $type + * (optional) The field type for the new field. Defaults to 'string'. + * @param string $entity_type_id + * (optional) The entity type ID the base field should be attached to. + * Defaults to 'entity_test_update'. + * @param bool $is_revisionable + * (optional) If the base field should be revisionable or not. Defaults to + * FALSE. + */ + protected function addBaseField($type = 'string', $entity_type_id = 'entity_test_update', $is_revisionable = FALSE) { + $definitions['new_base_field'] = BaseFieldDefinition::create($type) + ->setName('new_base_field') + ->setRevisionable($is_revisionable) + ->setLabel(t('A new base field')); + $this->state->set($entity_type_id . '.additional_base_field_definitions', $definitions); + } + + /** + * Adds a long-named base field to the 'entity_test_update' entity type. + */ + protected function addLongNameBaseField() { + $key = 'entity_test_update.additional_base_field_definitions'; + $definitions = $this->state->get($key, []); + $definitions['new_long_named_entity_reference_base_field'] = BaseFieldDefinition::create('entity_reference') + ->setName('new_long_named_entity_reference_base_field') + ->setLabel(t('A new long-named base field')) + ->setSetting('target_type', 'user') + ->setSetting('handler', 'default'); + $this->state->set($key, $definitions); + } + + /** + * Adds a new revisionable base field to the 'entity_test_update' entity type. + * + * @param string $type + * (optional) The field type for the new field. Defaults to 'string'. + */ + protected function addRevisionableBaseField($type = 'string') { + $definitions['new_base_field'] = BaseFieldDefinition::create($type) + ->setName('new_base_field') + ->setLabel(t('A new revisionable base field')) + ->setRevisionable(TRUE); + $this->state->set('entity_test_update.additional_base_field_definitions', $definitions); + } + + /** + * Modifies the new base field from 'string' to 'text'. + */ + protected function modifyBaseField() { + $this->addBaseField('text'); + } + + /** + * Promotes a field to an entity key. + */ + protected function makeBaseFieldEntityKey() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + $entity_keys = $entity_type->getKeys(); + $entity_keys['new_base_field'] = 'new_base_field'; + $entity_type->set('entity_keys', $entity_keys); + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Removes the new base field from the 'entity_test_update' entity type. + * + * @param string $entity_type_id + * (optional) The entity type ID the base field should be attached to. + */ + protected function removeBaseField($entity_type_id = 'entity_test_update') { + $this->state->delete($entity_type_id . '.additional_base_field_definitions'); + } + + /** + * Adds a single-field index to the base field. + */ + protected function addBaseFieldIndex() { + $this->state->set('entity_test_update.additional_field_index.entity_test_update.new_base_field', TRUE); + } + + /** + * Removes the index added in addBaseFieldIndex(). + */ + protected function removeBaseFieldIndex() { + $this->state->delete('entity_test_update.additional_field_index.entity_test_update.new_base_field'); + } + + /** + * Adds a new bundle field to the 'entity_test_update' entity type. + * + * @param string $type + * (optional) The field type for the new field. Defaults to 'string'. + */ + protected function addBundleField($type = 'string') { + $definitions['new_bundle_field'] = FieldStorageDefinition::create($type) + ->setName('new_bundle_field') + ->setLabel(t('A new bundle field')) + ->setTargetEntityTypeId('entity_test_update'); + $this->state->set('entity_test_update.additional_field_storage_definitions', $definitions); + $this->state->set('entity_test_update.additional_bundle_field_definitions.test_bundle', $definitions); + } + + /** + * Modifies the new bundle field from 'string' to 'text'. + */ + protected function modifyBundleField() { + $this->addBundleField('text'); + } + + /** + * Removes the new bundle field from the 'entity_test_update' entity type. + */ + protected function removeBundleField() { + $this->state->delete('entity_test_update.additional_field_storage_definitions'); + $this->state->delete('entity_test_update.additional_bundle_field_definitions.test_bundle'); + } + + /** + * Adds an index to the 'entity_test_update' entity type's base table. + * + * @see \Drupal\entity_test\EntityTestStorageSchema::getEntitySchema() + */ + protected function addEntityIndex() { + $indexes = [ + 'entity_test_update__new_index' => ['name', 'test_single_property'], + ]; + $this->state->set('entity_test_update.additional_entity_indexes', $indexes); + } + + /** + * Removes the index added in addEntityIndex(). + */ + protected function removeEntityIndex() { + $this->state->delete('entity_test_update.additional_entity_indexes'); + } + + /** + * Renames the base table to 'entity_test_update_new'. + */ + protected function renameBaseTable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $entity_type->set('base_table', 'entity_test_update_new'); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Renames the data table to 'entity_test_update_data_new'. + */ + protected function renameDataTable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $entity_type->set('data_table', 'entity_test_update_data_new'); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Renames the revision table to 'entity_test_update_revision_new'. + */ + protected function renameRevisionBaseTable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $entity_type->set('revision_table', 'entity_test_update_revision_new'); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Renames the revision data table to 'entity_test_update_revision_data_new'. + */ + protected function renameRevisionDataTable() { + $entity_type = clone $this->entityManager->getDefinition('entity_test_update'); + + $entity_type->set('revision_data_table', 'entity_test_update_revision_data_new'); + + $this->state->set('entity_test_update.entity_type', $entity_type); + } + + /** + * Removes the entity type. + */ + protected function deleteEntityType() { + $this->state->set('entity_test_update.entity_type', 'null'); + } + +} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php index a0acaef7571..4a26f109140 100644 --- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php +++ b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php @@ -4,7 +4,7 @@ namespace Drupal\Tests\system\Functional\Entity\Update; use Drupal\Core\Entity\Sql\TemporaryTableMapping; use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\system\Tests\Entity\EntityDefinitionTestTrait; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Defines a class for testing the conversion of entity types to revisionable. diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php index e226540b6ae..e696da67e81 100644 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php +++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php @@ -3,7 +3,7 @@ namespace Drupal\Tests\system\Functional\Update; use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\system\Tests\Entity\EntityDefinitionTestTrait; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests the upgrade path for adding the 'revision_default' field. diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php index f7dcd0c41bf..018c10f0517 100644 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php +++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php @@ -3,7 +3,7 @@ namespace Drupal\Tests\system\Functional\Update; use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\system\Tests\Entity\EntityDefinitionTestTrait; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests the upgrade path for adding the 'revision_translation_affected' field. diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php index 2312dc6f0a6..e2206bed268 100644 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php +++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php @@ -4,7 +4,7 @@ namespace Drupal\Tests\system\Functional\Update; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\system\Tests\Entity\EntityDefinitionTestTrait; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests the upgrade path for making an entity revisionable and publishable. diff --git a/core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php b/core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php index 35b7d6bd6e2..378d02c755f 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php @@ -2,9 +2,9 @@ namespace Drupal\Tests\taxonomy\Functional; -use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase; use Drupal\taxonomy\Entity\Vocabulary; use Drupal\taxonomy\Entity\Term; +use Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase; /** * Tests the Taxonomy term entity's cache tags. diff --git a/core/modules/user/tests/src/Functional/UserCacheTagsTest.php b/core/modules/user/tests/src/Functional/UserCacheTagsTest.php index a9e98575b7b..c9ab91fac71 100644 --- a/core/modules/user/tests/src/Functional/UserCacheTagsTest.php +++ b/core/modules/user/tests/src/Functional/UserCacheTagsTest.php @@ -2,7 +2,7 @@ namespace Drupal\Tests\user\Functional; -use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase; +use Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase; use Drupal\user\Entity\Role; use Drupal\user\Entity\User; use Drupal\user\RoleInterface; diff --git a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php index 2319a7064a9..24e4e6af510 100644 --- a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php +++ b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php @@ -4,7 +4,7 @@ namespace Drupal\Tests\views\Kernel\EventSubscriber; use Drupal\Core\Entity\EntityTypeEvent; use Drupal\Core\Entity\EntityTypeEvents; -use Drupal\system\Tests\Entity\EntityDefinitionTestTrait; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; use Drupal\Tests\views\Kernel\ViewsKernelTestBase; /** diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php index 4cbffedbf8c..01044f724a1 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php @@ -15,7 +15,7 @@ use Drupal\Core\Field\FieldException; use Drupal\Core\Field\FieldStorageDefinitionEvents; use Drupal\Core\Language\LanguageInterface; use Drupal\entity_test_update\Entity\EntityTestUpdate; -use Drupal\system\Tests\Entity\EntityDefinitionTestTrait; +use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; /** * Tests EntityDefinitionUpdateManager functionality.