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?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start at the haveInRepository implementation and trace how named constructor arguments are resolved for the Process and QueueItem example. Reproduce the reported case in a focused test and inspect the existing constructor-argument tests. Done means the behavior matches the documented example, or the documentation clearly states the supported limitation.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- database
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100