public function EntityTypeTest::testIsSerializable in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testIsSerializable()
- 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testIsSerializable()
Tests that the EntityType object can be serialized.
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityTypeTest.php, line 507
Class
- EntityTypeTest
- @coversDefaultClass \Drupal\Core\Entity\EntityType @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testIsSerializable() {
$entity_type = $this
->setUpEntityType([]);
$translation_service = new UnserializableTranslationManager();
$translation_service->_serviceId = 'string_translation';
$entity_type
->setStringTranslation($translation_service);
$entity_type = unserialize(serialize($entity_type));
$this
->assertEquals('example_entity_type', $entity_type
->id());
}