Open 2ur1st opened 8 months ago
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
Hi, thanks for good library How I can use method haveInRepository() with readonly property, Example: simple entity with embeddable property
I want use method haveInRepository() for creating test entities like this
But got error after run Cest:
How I can fix it? Thanks