diff options
author | Alex Pott <alex.a.pott@googlemail.com> | 2018-08-08 09:58:15 +0100 |
---|---|---|
committer | Alex Pott <alex.a.pott@googlemail.com> | 2018-08-08 09:58:15 +0100 |
commit | c5bbae9ba387a839421c41a2a1a238cda28a30bf (patch) | |
tree | 5b3d7873f0906b9a2f36e2b0f7788a5fe5e0214c | |
parent | f6c312eb3e2cbd33681af6a3d60e14b42068f3f5 (diff) | |
download | drupal-c5bbae9ba387a839421c41a2a1a238cda28a30bf.tar.gz drupal-c5bbae9ba387a839421c41a2a1a238cda28a30bf.zip |
Revert "Issue #2893029 by phenaproxima, Sam152, tim.plunkett, dawehner, a.dmitriiev, Berdir: StringTranslationTrait consumers cannot be reliably serialized without DependencySerializationTrait"
This reverts commit a367e2c967fb166ce9d1234ffbbc59c85648af86.
-rw-r--r-- | core/lib/Drupal/Core/Entity/EntityType.php | 2 | ||||
-rw-r--r-- | core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php | 19 |
2 files changed, 0 insertions, 21 deletions
diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index c6f320fd6e6..e28fdb0da43 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -3,7 +3,6 @@ namespace Drupal\Core\Entity; use Drupal\Component\Plugin\Definition\PluginDefinition; -use Drupal\Core\DependencyInjection\DependencySerializationTrait; use Drupal\Core\Entity\Exception\EntityTypeIdLengthException; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslatableMarkup; @@ -15,7 +14,6 @@ use Drupal\Core\StringTranslation\TranslatableMarkup; */ class EntityType extends PluginDefinition implements EntityTypeInterface { - use DependencySerializationTrait; use StringTranslationTrait; /** diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php index ab02902db45..b28a72c617f 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php @@ -5,7 +5,6 @@ namespace Drupal\Tests\Core\Entity; use Drupal\Core\Entity\EntityType; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; -use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Tests\UnitTestCase; /** @@ -477,22 +476,4 @@ class EntityTypeTest extends UnitTestCase { $this->assertEmpty($reflection->getProperties(\ReflectionProperty::IS_PUBLIC)); } - /** - * Test the EntityType object it serializable. - */ - public function testIsSerializable() { - $entity_type = $this->setUpEntityType([]); - - $translation = $this->prophesize(TranslationInterface::class); - $translation->willImplement(\Serializable::class); - $translation->serialize()->willThrow(\Exception::class); - $translation_service = $translation->reveal(); - $translation_service->_serviceId = 'string_translation'; - - $entity_type->setStringTranslation($translation_service); - $entity_type = unserialize(serialize($entity_type)); - - $this->assertEquals('example_entity_type', $entity_type->id()); - } - } |