Codeception / Codeception/module-doctrine

Enum Array Support with `simple_array` Type

未关闭
#6 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
4
派生
2
PR 合并指标
30 天内没有已合并 PR

描述

It seems that enum arrays are not supported, or am I doing something wrong?

```
/**
* @var FieldType[]
*
* @ORM\Column(type="simple_array", enumType="Demo\FieldType")
*/
private array $supportedFields;
```

I can't use `grabFromRepository()` or `seeInRepository()` as it seems like the module doesn't internally handle the conversion to a comma-delimited string properly. I'm not sure if this issue includes `haveInRepository()` as well since have not tested it.

```
$result = $this->tester->grabEntityFromRepository(Demo::class, [
...
'supportedFields' => [FieldType.Field1, FieldType.Field2, ...] // <-- problematic
]);
```

Crashes with a SyntaxErrorException:

```
Doctrine\DBAL\Exception\SyntaxErrorException : An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ","
LINE 1: ...$1 AND d0_.name = $2 AND d0_.supported_fields = $3, $4, $5, ...
^
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by locating grabEntityFromRepository(), grabFromRepository(), seeInRepository(), and haveInRepository() in the Doctrine module, then inspect how repository criteria are passed to Doctrine for simple_array fields. Reproduce the failure with the shown enum-array mapping and PostgreSQL setup. Done means the affected helpers handle the array value without generating invalid SQL, with regression coverage for the supported methods.

由索引模型根据 Issue 内容生成。

评估

技术栈
php, postgresql
领域
database, testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
64/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。