Codeception / Codeception/module-doctrine

Enum Array Support with `simple_array` Type

Open
#6 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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, ...
^
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.