Codeception / Codeception/module-doctrine
Method haveInRepository() does not work with readonly property in Embeddable
- Ngôn ngữ chính
- PHP
- Star
- 4
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi, thanks for good library
How I can use method **haveInRepository()** with readonly property,
Example: simple entity with embeddable property
```php
#[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
```php
$I->haveInRepository(new User(
address: new Address(
street: 'Test street',
city: 'Toronto'
);
);
```
**But got error after run Cest:**
```php
[LogicException] Attempting to change readonly property Address::$street.
```
**How I can fix it? Thanks**
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.