diff -u b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php --- b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php @@ -297,10 +297,10 @@ // Retrieve the entity properties. $reflection = new \ReflectionClass($entity); - $properties_filter = \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE; - $properties_clone = $reflection->getProperties($properties_filter); + $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE); + $translation_unique_properties = ['activeLangcode', 'translationInitialize', 'fieldDefinitions', 'languages', 'langcodeKey', 'defaultLangcode', 'defaultLangcodeKey', 'validated', 'validationRequired', 'entityTypeId', 'typedData', 'cacheContexts', 'cacheTags', 'cacheMaxAge', '_serviceIds']; - foreach ($properties_clone as $property) { + foreach ($properties as $property) { // Modify each entity property on the clone and assert that the change is // not propagated to the original entity. $property->setAccessible(TRUE); @@ -312,7 +312,6 @@ // except for the properties that are unique for each entity translation // object. $property->setValue($translation, 'test-translation-cloning'); - $translation_unique_properties = ['activeLangcode', 'translationInitialize', 'fieldDefinitions', 'languages', 'langcodeKey', 'defaultLangcode', 'defaultLangcodeKey', 'validated', 'validationRequired', 'entityTypeId', 'typedData', 'cacheContexts', 'cacheTags', 'cacheMaxAge', '_serviceIds']; // Using assertEquals or assertNotEquals here is dangerous as if the // assertion fails and the property for some reasons contains the entity // object e.g. the "typedData" property then the property will be