Unverified Commit 9b6643de authored by alexpott's avatar alexpott

Revert "Issue #2893029 by phenaproxima, Sam152, tim.plunkett, dawehner,...

Revert "Issue #2893029 by phenaproxima, Sam152, tim.plunkett, dawehner, a.dmitriiev, Berdir: StringTranslationTrait consumers cannot be reliably serialized without DependencySerializationTrait"

This reverts commit f4e81e05.
parent fab1556d
......@@ -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 @@
*/
class EntityType extends PluginDefinition implements EntityTypeInterface {
use DependencySerializationTrait;
use StringTranslationTrait;
/**
......
......@@ -5,7 +5,6 @@
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 @@ protected function assertNoPublicProperties(EntityTypeInterface $entity_type) {
$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());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment