Added tests for all API endpoints of Structural elements

This commit is contained in:
Jan Böhmer 2024-03-03 21:52:26 +01:00
parent 7b5ae70de3
commit 3d67ad870a
16 changed files with 887 additions and 3 deletions

View file

@ -180,6 +180,7 @@ abstract class Attachment extends AbstractNamedDBElement
#[ORM\JoinColumn(name: 'type_id', nullable: false)]
#[Selectable]
#[Groups(['attachment:read', 'attachment:write'])]
#[ApiProperty(readableLink: false)]
protected ?AttachmentType $attachment_type = null;
#[Groups(['attachment:read'])]

View file

@ -92,7 +92,7 @@ class AttachmentType extends AbstractStructuralDBElement
#[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'children')]
#[ORM\JoinColumn(name: 'parent_id')]
#[Groups(['attachment_type:read', 'attachment_type:write'])]
#[ApiProperty(readableLink: false, writableLink: false)]
#[ApiProperty(readableLink: true, writableLink: false)]
protected ?AbstractStructuralDBElement $parent = null;
/**

View file

@ -74,7 +74,7 @@ use Symfony\Component\Validator\Constraints as Assert;
denormalizationContext: ['groups' => ['measurement_unit:write', 'api:basic:write', 'attachment:write', 'parameter:write'], 'openapi_definition_name' => 'Write'],
)]
#[ApiResource(
uriTemplate: '/footprints/{id}/children.{_format}',
uriTemplate: '/measurement_units/{id}/children.{_format}',
operations: [
new GetCollection(
openapi: new Operation(summary: 'Retrieves the children elements of a MeasurementUnit.'),