Unverified Commit c8b93171 authored by alexpott's avatar alexpott

Issue #3132759 by mvonfrie, AaronBauman, anmolgoyal74, jungle, DamienMcKenna:...

Issue #3132759 by mvonfrie, AaronBauman, anmolgoyal74, jungle, DamienMcKenna: ConfigEntityType "missing 'config_export" error message doesn't say what annotation is missing

(cherry picked from commit b2519618)
parent de4d6358
......@@ -248,7 +248,7 @@ public function toArray() {
$id_key = $entity_type->getKey('id');
$property_names = $entity_type->getPropertiesToExport($this->id());
if (empty($property_names)) {
throw new SchemaIncompleteException(sprintf("Entity type '%s' is missing 'config_export' definition in its annotation", get_class($entity_type)));
throw new SchemaIncompleteException(sprintf("Entity type '%s' is missing 'config_export' definition in its annotation", $entity_type->getClass()));
}
foreach ($property_names as $property_name => $export_name) {
// Special handling for IDs so that computed compound IDs work.
......
......@@ -635,8 +635,11 @@ public function testToArraySchemaException() {
$this->entityType->expects($this->any())
->method('getPropertiesToExport')
->willReturn(NULL);
$this->entityType->expects($this->any())
->method('getClass')
->willReturn("FooConfigEntity");
$this->expectException(SchemaIncompleteException::class);
$this->expectExceptionMessageMatches("/Entity type 'Mock_ConfigEntityTypeInterface_[^']*' is missing 'config_export' definition in its annotation/");
$this->expectExceptionMessage("Entity type 'FooConfigEntity' is missing 'config_export' definition in its annotation");
$this->entity->toArray();
}
......
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