Codeception / Codeception/module-doctrine
`haveInRepository` gives constructor parameter missing?
- 主要语言
- PHP
- 星标
- 4
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
描述
```
/**
* @ORM\Entity
* @ORM\Table("processes")
*/
class Process extends Entity
{
/**
* @ORM\ManyToOne(inversedBy="processes")
* @ORM\JoinColumn(nullable=false)
*/
private QueueItem $queueItem;
public function __construct(QueueItem $queueItem)
{
$this->queueItem = $queueItem;
}
}
```
In test:
```
$processId = $this->tester->haveInRepository(Process::class, [
'queueItem' => ['name' => 'queue item name']
]);
```
Throws exception:
`InvalidArgumentException : Constructor parameter "queueItem" missing`
If I read the documentation correctly for `haveInRepository`:
> Alternatively, constructor arguments can be passed by name. Given User constructor signature is __constructor($arg), the example above could be rewritten like this: `$I->haveInRepository(User::class, ['arg' => $arg, 'name' => 'davert']);`
It should actually instantiate the `QueueItem` and pass it as the argument into the `Process` constructor or does it only work with scalar types?
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 haveInRepository 的实现开始,跟踪 Process 和 QueueItem 示例中命名构造函数参数的解析方式。在一个针对性测试中重现报告的案例,并检查现有的构造函数参数测试。完成的标准是行为与文档中的示例一致,或者文档明确说明所支持的限制。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- database
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100