Unverified Commit c8b93171 authored by Alex Pott's avatar Alex Pott
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.
+4 −1
Original line number Diff line number Diff line
@@ -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();
  }