$exception = CustomEntityException::
noLabelProperty();
static::
assertSame(Response::HTTP_INTERNAL_SERVER_ERROR,
$exception->
getStatusCode());
static::
assertSame(CustomEntityException::CUSTOM_FIELDS_AWARE_NO_LABEL_PROPERTY,
$exception->
getErrorCode());
static::
assertSame('Entity must have a label property when it is custom field aware',
$exception->
getMessage());
} public function testLabelPropertyNotDefined(): void
{ $labelProperty = 'some_label';
$exception = CustomEntityException::
labelPropertyNotDefined($labelProperty);
static::
assertSame(Response::HTTP_INTERNAL_SERVER_ERROR,
$exception->
getStatusCode());
static::
assertSame(CustomEntityException::CUSTOM_FIELDS_AWARE_LABEL_PROPERTY_NOT_DEFINED,
$exception->
getErrorCode());
static::
assertSame('Entity label_property "some_label" is not defined in fields',
$exception->
getMessage());
} public function testLabelPropertyWrongType(): void
{ $labelProperty = 'some_label';
$exception = CustomEntityException::
labelPropertyWrongType($labelProperty);