Open
Description
Hi, thanks for good library
How I can use method haveInRepository() with readonly property,
Example: simple entity with embeddable property
#[Entity]
class User
{
public function __construct(
#[Embedded(class: Address::class)] private Address $address
) {
}
public function getAddres(): Address
{
return $this->address;
}
}
#[Embeddable]
class Address
{
#[Column(type: "string")]
private readonly string $street;
#[Column(type: "string")]
private readonly string $city;
}
I want use method haveInRepository() for creating test entities like this
$I->haveInRepository(new User(
address: new Address(
street: 'Test street',
city: 'Toronto'
);
);
But got error after run Cest:
[LogicException] Attempting to change readonly property Address::$street.
How I can fix it? Thanks
Metadata
Metadata
Assignees
Labels
No labels